Skip to main content

C tutorial for complete beginners(intro to C language)



     Any programming language has four important aspects viz
* The way it stores data
* The way it operates upon this data
* The way it accomplishes input and output
* The way lets u control the sequence of execution of program. 

What is C? 

C was developed by Ritchie in 1972 at AT and T's Bell laboratories, USA. Interestingly no one pushed it and there was no advertisement made but still programmers of the time preferred it over the older ones like FORTRAN. It was popular due to its simplicity, reliability and it's ease. 

Inventor of C language,   Dennis Ritchie

Why Still C in 2019? 

As per today's opinion that C has been superseded by C++, C# and java one must still start his programming journey with C due to following reasons:
1. C++and C# use object oriented programming and basic programming skills         of C. 

2. Mobile devices are today's rage and device like watches, camera, ovens, tvs         are getting smarter day by day. This smartness comes from the                             microprocessor installed in them. This microprocessor has limited memory        space for the instruction codes which makes C the first choice for the                    coders to    write device driver program. 

3. Major parts of operating system like LINUX and Windows are written in C. 

4. No language beats C when it comes to speed of excecution. 
    In the combat games like "fox one advanced" Where one has to shoot bullets       and missiles immediately along with navigating the plane at a high speed to        dodge the enemy missiles ,speed brings all the thrill! . U can't play the game         very slowly. The game has to react faster to the user. This is where C l l                 language scores over other languages. 

5. C language is preferred at times when one needs to closely interact with the
      hardware. 

Let's get started:

Like we communicate say in English here, communicating with a computer involves a language which it understand. 
Like in English we begin to learn by first learning alphabet, wods and then sentence and then paragraph,  in C we learn alphabet, digits, special symbols, variables and then instructions followed by programs . 


Character set in C

Character denotes any alphabet, digit or a special symbol that is used to represent information. 
Following special symbols are allowed in C.


Constants in C:

Constants in C are those entities which have fixed values.


We will discuss the further types in details later on
But discussing primary constants  is important.

Rules for construction of Integer constants:

1. An integer constant must have at least one digit. 
2. It should not have a decimal . 
3. It can either be positive or negative. 
4. No commas or blanks are allowed within an integer constant. 
5. If no sign is given before the integer constant, then it's assumed to be                     positive. 
Examples: 56,+54, -900 etc. 

Rules for construction of Real constants:

1. The real constants can be written in two forms-decimal and fraction
2. It could be either positive or negative. 
3. It must have at least one digit. 
4. No commas or blanks are allowed within a real constant. 
5. Default sign is positive. 

     Ex- 232.8,-43.8, etc

Rules for construction of character constants:

1. A character constant is a single digit, alphabet or any single special symbol         but it must be enclosed within single inverted commas. 
2. Both the inverted commas should point towards left. 
 
     Ex_  '1', '&', 'a' etc

Variables in C 

Variables in C hold different values of constants in them. 
For example an integer variable holds integer constant say 4.
When you declare a variable in C, a part of memory space is allotted to that variable and its value is then stored over there during program excecution. 

Rules:-
1. A variable name can be any combination of 27 alphabets, digits and                       characters.
2. The first character in the variable name must be an alphabet or                               underscore(_).
3. No commas or blanks are allowed within a variable name.
4. No special symbols other than underscore is allowed.
5. Variable name is case sensitive i. e. VARIABLE and variable are two different       variables in c.

Keywords in C :

Keywords are those words that are already been explained to the compiler. There are 32 keywords available in C.
Some are
Auto, break, while, double, int, float, if,switch, char, else, etc.

Conclusions:

1. You will be introduced to the origin of C programming language. 

2.  Like any language has several components and Subcomponents like                     alphabets, words, sentences and paragraphs
 
C language has alphabets, digits, special symbol, keywords, constants, and          variables as its subparts.
 

Did u guys find it helpful??
Should the tutorial be continued?
U are free to comment and share ur views and suggestions. 






Comments

  1. Very helpful, kind of boost reminder for me as a beginner......
    Thank you atharva

    ReplyDelete

Post a Comment

Popular posts from this blog

Python tutorial - #4 (Operators in Python)

OPERATORS IN PYTHON The general purpose of a program is to accept data and perform some operations on the data. The data in the program is stored in variables. The next question is how to perform operations on the data. For example, when a programmer wants to add two numbers, he simply type '+' symbol. This symbol performs addition operation. Such symbols are called operators. ⇨ Operator = An operator is a symbol that performs an operation.  When an operator acts on some variables then it is called operands . Example :- a + b in the given equation '+' operator acts on two operands 'a' and 'b'. If an operator acts on single operands then it is called unary operator . And when an operator acts on two operands then it is called binary operator . And when an operator acts on more than two operands (variable) It is called Tertiary operator . ➠Classifications of Operator -- a) Arthimatic operators b) Assignment operators c) Unary minu...

Python tutorial - #5 (Operators in Python)

Membership Operators This operator helps us to check an element is found in a sequence or not. It gives there result in Boolean value (True or False). ➥There are two types of Membership operator :- a) in b) not in ➢in membership operator This membership operator returns True if an element is found in a sequence and it returns  False When an element is not found in a sequence. Program - #1 ➢not in membership operator This membership operator returns True if an element is not found in a sequence and it returns False if an element is found in a sequence. Program = #2 Identity Operators This operator helps us to check whether two element are same or not. Actually, this operator compares the memory location of two object, if the memory locations are same then objects are also same otherwise the objects are not same.                                      ...

Python tutorial - #6 (Control statements)

Control Statements When we write a simple program, generally it executes line by line and this execution are called sequential execution. This type of execution is suitable only for developing simple programs. It is not suitable for developing complex programs. To develop a program which contains complex logic. Then we need to execute statements according to our requirement for this we uses Control statements in which we can control the statements according to our need.  ➠ There are types of control statements in Python:- a) If... statements b) If... else.. Statements c) If...elif....else.. Statements  d) While loop  e) For loop f) Nested loop  g) Else suit h) Continue statements  i) Break statements j) Pass statements  k) Assert statements l) Return statements  ↷If... statements    Syntax:-  if condition:                 Statements Here, at first...