[email protected] +91 9175287066
This website is always under updation with new contents
C Language Tutorials
Introduction
C’s character set
Variables
Constant
Identifiers
Keywords
C Tokens
Datatypes
Operator
Typecasting
ASCII
Increment and Decrement operator
Input output Operation
Reading and writing string
Branching statement
Simple If
If Else
Nested else if
Ladder else if
Switch Case Statement
Looping
While loop
Do while loop
For Loop
break statement
goto statement
continue
One dimensional array
Two dimensional array
Call by value
Call by reference
Recursion function
auto
extern
static
register
malloc()
calloc()
realloc()
C Programming Language
Introduction
C is structured oriented programming language it was developed at Bell Laboratories AT&T (American Telephone & Telegraph), located in U.S.A. by Dennis Ritchie in 1972. It is also called as middle level language because it is used to develop application software and system software. C support rich set of operators.
Initially C-language was developed for designing a compiler of UNIX-Operating System.

Founder of C Language

C’s character set
1. Alphabet A to Z
2. a to z
3. Special symbol ( ‘, < > , “ , ? ; - ; )
Variables
It is a name given to storage area and its value change during program execution.
It is used to store data , and its value change at any time.
Rules for defining variable
1. Variable name must start with alphabet and underscore.
2. Space are not allowed.
3. Keywords are not allowed.
4. Special symbol are not allowed.
5. Digits are allowed but first character must be alphabet or underscore.
6. Variable length should be 1 to 8 character long.
Syntax for variable declaration
Syntax:-     type  variable_name;
EX:- Example for declaring a variable.
          int  a;
         float  b;
 here  a, b are a variable  and  int , float are datatype .
 
There are five types of variable available in C they are given below.
a) local variable
b) global variable
c) static variable
d) automatic variable
e) external variable
Q> Why only underscore is allowed in variable declaration ?
Ans> There are following reason to used underscore.
1. Underscore is best and understandable if we used in any variable definition.
2. It provide understandable readable format. 3. It is the besst way to separate two names
Local variable
These variables only exist inside the specific function that creates them. They are unknown to other functions and to the main program.
Global Variable
A variable that is declared outside the function or block or body is called global variable. If any function changes the value of the global variable so it will be changed for all. It must be declared at the start of the block.
Static Variable
A variable that is declared with static keyword is called static variable. It is declared at once and never changed before leaving the program.
Automatic Variable
All variables declared inside the block, are automatic variables by default. But we can also explicitly declare automatic variable using auto keyword.
External Variable
We can share a variable in multiple C source files by using external variable. To declare a external variable, we need to use extern keyword.
Constant
It is a fixed entity which does not change during program execution.
Classification of C constant


Identifiers
It is a name given to variable, function, array, structure ,union etc.
Keywords

It is a reserved keywords whose meaning allredy define in C compiler user can not change them. C support 32 keywords.



C Tokens
It is a smallest unit of any expression like Variable, Constant, Keywords, String, Operators
Ex:


Datatypes
Datatypes tells the which types of value hold by variable like as integer , float, char. C support three types of datatype 1.Primery datatype 2. User define datatype 3. Derived datatype.
Detail concept of dataypes their size, control string, range given below



Operator
Operator is a special symbol which perform arithmetic and logical operation. C support 8 types of operator they are given below.

For accessing computer programs go to TECHNOLOGY