C LANGUAGE
C is a Programming Language developed by "Dennis Ritchie" at
AT&T Bell Labaratory in 1970's.
c is middle level language.
Compiler-> converts into binary digits,
It reads whole program
Advantages:
Easy To Learn
Simple
Portable
Flexible
Structure Of Program:
//->single line comment
/*.............*/->multiline comment
1.header file:
# include<stdio.h>
#include<conio.h>
#->preprocessor directive
2.void main() (or) int main()
{
----- //body of the loop
, -----
}
3.printf("hello"); ->for display the output
4.scanf("%d",&a); ->for get the input
5.getch(); ->to get the character (OR) return 0;
6.\n ,\t ->new line, tab space
7.clrscr(); ->to clear the screen
Data Types:
1.int -2bytes
2.char -1bytes
3.float -4bytes
4.double - 8bytes
5.long double -10 bytes
Variables:
a,b,c etc.....
Declaration:
int a;
float c;
char name;
Initialization:
, int a=10;
float c=20.5;
char name='a';
Operators:
1.Arithmetic operators +,-,*,/,%
2.Increment and Decrement operators
pre increment ++a;
post increment a++;
pre decrement --a;
post decrement a--;
3. Relational operators
== equal
!= not equal
> greater than
< less than
>= greater than or equal
<= less than or equal
4.Logical operators
&& logical AND
|| logical OR
C is a Programming Language developed by "Dennis Ritchie" at
AT&T Bell Labaratory in 1970's.
c is middle level language.
Compiler-> converts into binary digits,
It reads whole program
Advantages:
Easy To Learn
Simple
Portable
Flexible
Structure Of Program:
//->single line comment
/*.............*/->multiline comment
1.header file:
# include<stdio.h>
#include<conio.h>
#->preprocessor directive
2.void main() (or) int main()
{
----- //body of the loop
, -----
}
3.printf("hello"); ->for display the output
4.scanf("%d",&a); ->for get the input
5.getch(); ->to get the character (OR) return 0;
6.\n ,\t ->new line, tab space
7.clrscr(); ->to clear the screen
Data Types:
1.int -2bytes
2.char -1bytes
3.float -4bytes
4.double - 8bytes
5.long double -10 bytes
Variables:
a,b,c etc.....
Declaration:
int a;
float c;
char name;
Initialization:
, int a=10;
float c=20.5;
char name='a';
Operators:
1.Arithmetic operators +,-,*,/,%
2.Increment and Decrement operators
pre increment ++a;
post increment a++;
pre decrement --a;
post decrement a--;
3. Relational operators
== equal
!= not equal
> greater than
< less than
>= greater than or equal
<= less than or equal
4.Logical operators
&& logical AND
|| logical OR