SlideShare a Scribd company logo
1 of 59
Download to read offline
DIPTA SAHA
Diptasaha.lpu.cse@gmail.com
History Of
C is a middle level programming language.which is
developed by Dennis Ritchie while working at AT&T Bell
Labs in USA in between 1969 and 1973.
{
First C Program;
}
 1#include<stdio.h>
 2 int main()
 3 {
 4 printf("Hello C");
 5 return 0;
 6 }
{
Comments in C Program;
}
Single Line comment
/*…comments…..*/
Multi Line Comments
/*
Comments
*/
{
Variable in C;
}
{
Local Variable in C;
}
A local variable is a variable that is declared inside a function.
{
Global Variable in C;
}
A Global variable is a variable that is declared Outsite a function.
{
Data type in C;
}
{
Size of Data type in C;
}
int 2 -32768 to +32767
long 4 -2,147,483,648 to
2,147,483,647
Float 4 1.2E-38 to 3.4E+38
Double 8 2.3E-308 to 1.7E+308
Char 1 -128 to +127
Data Type Name Size(Byte) Range
{
Variable Declaration in C;
}
 Syntax
Datatype_name variable_name;
or
Datatype_name variable_name = values;
Example
Int a;
Or
Int a = 100;
{
Constant Variable Declaration in C;
}
 Syntax
Const Datatype_name variable_name = values;
Example
Const float pi = 3.1416;
{
Format Specifier in C;
}
{
Escape Sequence in C;
}
•n (newline)
•t (tab)
•v (vertical tab)
•f (new page)
•b (backspace)
•r (carriage return)
•n (newline)
{
get From User in C;
}
 Syntax
scanf("%d",&i);
Example
Int a;
Scanf(“%d”,&a);
{
Simple Program for get From User in C;
}
{
Operator in C;
}
C language is rich in built-in operators and provides the
following types of operators −
1. Arithmetic Operators
2. Relational Operators
3. Logical Operators
4. Bitwise Operators
5. Assignment Operator
{
Arithmetic Operator in C;
}
{
Relational Operator in C;
}
{
Logical Operator in C;
}
{
Bitwise Operator in C;
}
{
Assingment Operator in C;
}
{
Condition Operator in C;
}
Syntax:
(condition) ? True_res : false_res;
#include <stdio.h>
int main()
{
int x=1, y ;
y = ( x ==1 ? 2 : 0 ) ;
printf("x value is %dn", x);
printf("y value is %d", y);
}
{
Simple Program Using Operator in C;
}
 1 #include<stdio.h>
 2int main()
 3{
 4 int a=10,b=5;
 5 int add = a+b;
 6 int sub = a-b;
 7 int mul = a*b;
 8 int div = a/b;
 9 printf(“Add = %d”,add);
 10 printf(“Sub = %d”,sub);
 11 printf(“mul = %d”,mul);
 12. printf(“div = %d”,div);
 13return 0;
 14}
{
Decision making in C;
}
{
Conditional Execution in C;
}
In the c programming have some decision making Statement.
1. if statement
2. if...else statement
3. nested if statements
4.switch statement
5. nested switch statements
{
If Condition in C;
}
 Syntax
If(condition)
{
Statement..1;
Statement..2;
Statement..n;
}
{
Simple Program using If Condition in C;
}
{
if else Condition in C;
}
 Syntax
If(condition)
{
Statement;
}
Else
{
Statement;
}
{
Simple Program using If else Condition in C;
}
{
Nested if Condition in C;
}
 Syntax
If(condition)
{
Statement;
if(condition)
{
Statement;
}
}
{
Switch Statement in C;
}
 Syntax
Switch(expression)
{
Case constant_expression_1:
Statement 1;
Break;
Case constant_expression_2:
Statement 2;
Break;
Case constant_expression_3:
Statement 3;
Break;
Default:
Statement 4;
}
{
nested Switch Statement in C;
}  Syntax
Switch(expression-1)
{
Case constant_expression_1:
Switch(expression-1)
{
case constant_expression :
statement;
break;
}
Break;
Case constant_expression_2:
Statement 2;
Break;
Default:
Statement 3;
}
{
Loops in C;
}
{
Types of Loops in C;
}
1. while loop
2. for loop
3. do...while loop
4. nested loops
{
while Loop in C;
}
Syntax
Initialization;
While(condition)
{
Statement..1;
Statement..2;
Statement..n;
increment/decrement;
}
{
A simple Program using While Loop in C;
}
{
for Loop in C;
}
Syntax
for(Initialization;condition; increment/decrement)
{
Statement..1;
Statement..2;
Statement..n;
}
{
A simple Program using For Loop in C;
}
{
do while Loop in C;
}
Syntax
Initialization;
do
{
Statement..1;
Statement..2;
Statement..n;
increment/decrement;
}
While(condition)
{
A simple Program using Do While Loop in C;
}
{
nested for Loop in C;
}
Syntax
for(Initialization;condition; increment/decrement)
{
Statement..1;
for(Initialization;condition; increment/decrement)
{
Statement..1;
Statement..2;
Statement..n;
}
}
{
Break Statement in C;
}
The break statement terminates the loop body immediately
and passes control to the next statement after the loop. Break
statement are mainly used with loop and switch statement.
{
A Simple Program Using Break Statement in C;
}
{
Continue Statement in C;
}
The continue statement in C programming works somewhat
like the breakstatement.
{
A Simple Program Using continue Statement in C;
}
{
Function in C;
} Syntax
Return_type function_name(argument)
{
statement;
return need_variable;
}
Example:
Int sum(int x,int y)
{
return x+y;
}
{
Function call in C;
}
Syntax:
Function_name(parameter or argument);
Example:
1 #include<stdio.h>
2 int main()
3 {
4 Int z=sum(10,20);
5 printf(z);
6 return 0;
7 }
{
Array in C;
}
{
Types Of Array in C;
}
{
Single Dimensional Array in C;
}
Syntax
data_type array_name [size];
{
Multi Dimensional Array in C;
}
Syntax
data_type array_name [row_size][column_size];
{
A simple program using 1D Array in C;
}
{
* Pointer in C;
}
A pointer is a variable whose value is the address of
another variable. Like any variable or constant, you must
declare a pointer before using it to store any variable
address.
{
Declaration of Pointer in C;
}
Syntax
data_type *var_name;
Example
int var = 20;
int *ip;
ip = &var;
{
A Simple Program Using Pointer in C;
}
{
File in C;
}
file is a place on your physical disk where information is stored.
Open a File
FILE *name;
name = fopen(“text.txt","a");
fclose(name);
{
File in C;
}
Write in a File
FILE *name;
name = fopen(“text.txt",“w");
If(name == NULL)
{
printf(“File Dose Not exist”);
}
else
{
for(i = 0; i < 10;i++){
fprintf (fp, "This is line %dn",i + 1);
}
fclose(name);
}
{
File in C;
}
Read in a File
FILE *name;
name = fopen(“text.txt",“w");
Char buff[200];
If(name == NULL)
{
printf(“File Dose Not exist”);
}
else
{
while(fscanf(fp, "%s", buff)!=EOF){
printf("%s ", buff );
}
fclose(name);
}
exit(Presentation);

More Related Content

Similar to cuptopointer-180804092048-190306091149 (2).pdf

Similar to cuptopointer-180804092048-190306091149 (2).pdf (20)

Unit-IV.pptx
Unit-IV.pptxUnit-IV.pptx
Unit-IV.pptx
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
presentation_c_basics_1589366177_381682.pptx
presentation_c_basics_1589366177_381682.pptxpresentation_c_basics_1589366177_381682.pptx
presentation_c_basics_1589366177_381682.pptx
 
C Programming Unit-2
C Programming Unit-2C Programming Unit-2
C Programming Unit-2
 
C fundamentals
C fundamentalsC fundamentals
C fundamentals
 
Fundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan KumariFundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan Kumari
 
An imperative study of c
An imperative study of cAn imperative study of c
An imperative study of c
 
C decision making and looping.
C decision making and looping.C decision making and looping.
C decision making and looping.
 
C programing Tutorial
C programing TutorialC programing Tutorial
C programing Tutorial
 
Unit i intro-operators
Unit   i intro-operatorsUnit   i intro-operators
Unit i intro-operators
 
C prog ppt
C prog pptC prog ppt
C prog ppt
 
C intro
C introC intro
C intro
 
the refernce of programming C notes ppt.pptx
the refernce of programming C notes ppt.pptxthe refernce of programming C notes ppt.pptx
the refernce of programming C notes ppt.pptx
 
C programming
C programmingC programming
C programming
 
Basics of C porgramming
Basics of C porgrammingBasics of C porgramming
Basics of C porgramming
 
UNIT-II CP DOC.docx
UNIT-II CP DOC.docxUNIT-II CP DOC.docx
UNIT-II CP DOC.docx
 
C language
C languageC language
C language
 
2 EPT 162 Lecture 2
2 EPT 162 Lecture 22 EPT 162 Lecture 2
2 EPT 162 Lecture 2
 
C programming
C programmingC programming
C programming
 
What is c
What is cWhat is c
What is c
 

Recently uploaded

Call Girl in Low Price Delhi Punjabi Bagh 9711199012
Call Girl in Low Price Delhi Punjabi Bagh  9711199012Call Girl in Low Price Delhi Punjabi Bagh  9711199012
Call Girl in Low Price Delhi Punjabi Bagh 9711199012sapnasaifi408
 
女王大学硕士毕业证成绩单(加急办理)认证海外毕业证
女王大学硕士毕业证成绩单(加急办理)认证海外毕业证女王大学硕士毕业证成绩单(加急办理)认证海外毕业证
女王大学硕士毕业证成绩单(加急办理)认证海外毕业证obuhobo
 
内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士
内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士
内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士obuhobo
 
办理学位证(Massey证书)新西兰梅西大学毕业证成绩单原版一比一
办理学位证(Massey证书)新西兰梅西大学毕业证成绩单原版一比一办理学位证(Massey证书)新西兰梅西大学毕业证成绩单原版一比一
办理学位证(Massey证书)新西兰梅西大学毕业证成绩单原版一比一A SSS
 
Application deck- Cyril Caudroy-2024.pdf
Application deck- Cyril Caudroy-2024.pdfApplication deck- Cyril Caudroy-2024.pdf
Application deck- Cyril Caudroy-2024.pdfCyril CAUDROY
 
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call Girls
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call GirlsSonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call Girls
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call GirlsNiya Khan
 
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...Suhani Kapoor
 
Outsmarting the Attackers A Deep Dive into Threat Intelligence.docx
Outsmarting the Attackers A Deep Dive into Threat Intelligence.docxOutsmarting the Attackers A Deep Dive into Threat Intelligence.docx
Outsmarting the Attackers A Deep Dive into Threat Intelligence.docxmanas23pgdm157
 
加利福尼亚大学伯克利分校硕士毕业证成绩单(价格咨询)学位证书pdf
加利福尼亚大学伯克利分校硕士毕业证成绩单(价格咨询)学位证书pdf加利福尼亚大学伯克利分校硕士毕业证成绩单(价格咨询)学位证书pdf
加利福尼亚大学伯克利分校硕士毕业证成绩单(价格咨询)学位证书pdfobuhobo
 
Call Girls In Bhikaji Cama Place 24/7✡️9711147426✡️ Escorts Service
Call Girls In Bhikaji Cama Place 24/7✡️9711147426✡️ Escorts ServiceCall Girls In Bhikaji Cama Place 24/7✡️9711147426✡️ Escorts Service
Call Girls In Bhikaji Cama Place 24/7✡️9711147426✡️ Escorts Servicejennyeacort
 
办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改
办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改
办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改yuu sss
 
定制(NYIT毕业证书)美国纽约理工学院毕业证成绩单原版一比一
定制(NYIT毕业证书)美国纽约理工学院毕业证成绩单原版一比一定制(NYIT毕业证书)美国纽约理工学院毕业证成绩单原版一比一
定制(NYIT毕业证书)美国纽约理工学院毕业证成绩单原版一比一2s3dgmej
 
原版快速办理MQU毕业证麦考瑞大学毕业证成绩单留信学历认证
原版快速办理MQU毕业证麦考瑞大学毕业证成绩单留信学历认证原版快速办理MQU毕业证麦考瑞大学毕业证成绩单留信学历认证
原版快速办理MQU毕业证麦考瑞大学毕业证成绩单留信学历认证nhjeo1gg
 
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service CuttackVIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service CuttackSuhani Kapoor
 
原版定制卡尔加里大学毕业证(UC毕业证)留信学历认证
原版定制卡尔加里大学毕业证(UC毕业证)留信学历认证原版定制卡尔加里大学毕业证(UC毕业证)留信学历认证
原版定制卡尔加里大学毕业证(UC毕业证)留信学历认证diploma001
 
NPPE STUDY GUIDE - NOV2021_study_104040.pdf
NPPE STUDY GUIDE - NOV2021_study_104040.pdfNPPE STUDY GUIDE - NOV2021_study_104040.pdf
NPPE STUDY GUIDE - NOV2021_study_104040.pdfDivyeshPatel234692
 
PM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring ChapterPM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring ChapterHector Del Castillo, CPM, CPMM
 
Black and White Minimalist Co Letter.pdf
Black and White Minimalist Co Letter.pdfBlack and White Minimalist Co Letter.pdf
Black and White Minimalist Co Letter.pdfpadillaangelina0023
 
办理学位证(UoM证书)北安普顿大学毕业证成绩单原版一比一
办理学位证(UoM证书)北安普顿大学毕业证成绩单原版一比一办理学位证(UoM证书)北安普顿大学毕业证成绩单原版一比一
办理学位证(UoM证书)北安普顿大学毕业证成绩单原版一比一A SSS
 

Recently uploaded (20)

Call Girl in Low Price Delhi Punjabi Bagh 9711199012
Call Girl in Low Price Delhi Punjabi Bagh  9711199012Call Girl in Low Price Delhi Punjabi Bagh  9711199012
Call Girl in Low Price Delhi Punjabi Bagh 9711199012
 
Young Call~Girl in Pragati Maidan New Delhi 8448380779 Full Enjoy Escort Service
Young Call~Girl in Pragati Maidan New Delhi 8448380779 Full Enjoy Escort ServiceYoung Call~Girl in Pragati Maidan New Delhi 8448380779 Full Enjoy Escort Service
Young Call~Girl in Pragati Maidan New Delhi 8448380779 Full Enjoy Escort Service
 
女王大学硕士毕业证成绩单(加急办理)认证海外毕业证
女王大学硕士毕业证成绩单(加急办理)认证海外毕业证女王大学硕士毕业证成绩单(加急办理)认证海外毕业证
女王大学硕士毕业证成绩单(加急办理)认证海外毕业证
 
内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士
内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士
内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士
 
办理学位证(Massey证书)新西兰梅西大学毕业证成绩单原版一比一
办理学位证(Massey证书)新西兰梅西大学毕业证成绩单原版一比一办理学位证(Massey证书)新西兰梅西大学毕业证成绩单原版一比一
办理学位证(Massey证书)新西兰梅西大学毕业证成绩单原版一比一
 
Application deck- Cyril Caudroy-2024.pdf
Application deck- Cyril Caudroy-2024.pdfApplication deck- Cyril Caudroy-2024.pdf
Application deck- Cyril Caudroy-2024.pdf
 
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call Girls
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call GirlsSonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call Girls
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call Girls
 
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...
 
Outsmarting the Attackers A Deep Dive into Threat Intelligence.docx
Outsmarting the Attackers A Deep Dive into Threat Intelligence.docxOutsmarting the Attackers A Deep Dive into Threat Intelligence.docx
Outsmarting the Attackers A Deep Dive into Threat Intelligence.docx
 
加利福尼亚大学伯克利分校硕士毕业证成绩单(价格咨询)学位证书pdf
加利福尼亚大学伯克利分校硕士毕业证成绩单(价格咨询)学位证书pdf加利福尼亚大学伯克利分校硕士毕业证成绩单(价格咨询)学位证书pdf
加利福尼亚大学伯克利分校硕士毕业证成绩单(价格咨询)学位证书pdf
 
Call Girls In Bhikaji Cama Place 24/7✡️9711147426✡️ Escorts Service
Call Girls In Bhikaji Cama Place 24/7✡️9711147426✡️ Escorts ServiceCall Girls In Bhikaji Cama Place 24/7✡️9711147426✡️ Escorts Service
Call Girls In Bhikaji Cama Place 24/7✡️9711147426✡️ Escorts Service
 
办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改
办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改
办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改
 
定制(NYIT毕业证书)美国纽约理工学院毕业证成绩单原版一比一
定制(NYIT毕业证书)美国纽约理工学院毕业证成绩单原版一比一定制(NYIT毕业证书)美国纽约理工学院毕业证成绩单原版一比一
定制(NYIT毕业证书)美国纽约理工学院毕业证成绩单原版一比一
 
原版快速办理MQU毕业证麦考瑞大学毕业证成绩单留信学历认证
原版快速办理MQU毕业证麦考瑞大学毕业证成绩单留信学历认证原版快速办理MQU毕业证麦考瑞大学毕业证成绩单留信学历认证
原版快速办理MQU毕业证麦考瑞大学毕业证成绩单留信学历认证
 
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service CuttackVIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
 
原版定制卡尔加里大学毕业证(UC毕业证)留信学历认证
原版定制卡尔加里大学毕业证(UC毕业证)留信学历认证原版定制卡尔加里大学毕业证(UC毕业证)留信学历认证
原版定制卡尔加里大学毕业证(UC毕业证)留信学历认证
 
NPPE STUDY GUIDE - NOV2021_study_104040.pdf
NPPE STUDY GUIDE - NOV2021_study_104040.pdfNPPE STUDY GUIDE - NOV2021_study_104040.pdf
NPPE STUDY GUIDE - NOV2021_study_104040.pdf
 
PM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring ChapterPM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring Chapter
 
Black and White Minimalist Co Letter.pdf
Black and White Minimalist Co Letter.pdfBlack and White Minimalist Co Letter.pdf
Black and White Minimalist Co Letter.pdf
 
办理学位证(UoM证书)北安普顿大学毕业证成绩单原版一比一
办理学位证(UoM证书)北安普顿大学毕业证成绩单原版一比一办理学位证(UoM证书)北安普顿大学毕业证成绩单原版一比一
办理学位证(UoM证书)北安普顿大学毕业证成绩单原版一比一
 

cuptopointer-180804092048-190306091149 (2).pdf

  • 2. History Of C is a middle level programming language.which is developed by Dennis Ritchie while working at AT&T Bell Labs in USA in between 1969 and 1973.
  • 3. { First C Program; }  1#include<stdio.h>  2 int main()  3 {  4 printf("Hello C");  5 return 0;  6 }
  • 4. { Comments in C Program; } Single Line comment /*…comments…..*/ Multi Line Comments /* Comments */
  • 6. { Local Variable in C; } A local variable is a variable that is declared inside a function.
  • 7. { Global Variable in C; } A Global variable is a variable that is declared Outsite a function.
  • 9. { Size of Data type in C; } int 2 -32768 to +32767 long 4 -2,147,483,648 to 2,147,483,647 Float 4 1.2E-38 to 3.4E+38 Double 8 2.3E-308 to 1.7E+308 Char 1 -128 to +127 Data Type Name Size(Byte) Range
  • 10. { Variable Declaration in C; }  Syntax Datatype_name variable_name; or Datatype_name variable_name = values; Example Int a; Or Int a = 100;
  • 11. { Constant Variable Declaration in C; }  Syntax Const Datatype_name variable_name = values; Example Const float pi = 3.1416;
  • 13. { Escape Sequence in C; } •n (newline) •t (tab) •v (vertical tab) •f (new page) •b (backspace) •r (carriage return) •n (newline)
  • 14. { get From User in C; }  Syntax scanf("%d",&i); Example Int a; Scanf(“%d”,&a);
  • 15. { Simple Program for get From User in C; }
  • 16. { Operator in C; } C language is rich in built-in operators and provides the following types of operators − 1. Arithmetic Operators 2. Relational Operators 3. Logical Operators 4. Bitwise Operators 5. Assignment Operator
  • 22. { Condition Operator in C; } Syntax: (condition) ? True_res : false_res; #include <stdio.h> int main() { int x=1, y ; y = ( x ==1 ? 2 : 0 ) ; printf("x value is %dn", x); printf("y value is %d", y); }
  • 23. { Simple Program Using Operator in C; }  1 #include<stdio.h>  2int main()  3{  4 int a=10,b=5;  5 int add = a+b;  6 int sub = a-b;  7 int mul = a*b;  8 int div = a/b;  9 printf(“Add = %d”,add);  10 printf(“Sub = %d”,sub);  11 printf(“mul = %d”,mul);  12. printf(“div = %d”,div);  13return 0;  14}
  • 25. { Conditional Execution in C; } In the c programming have some decision making Statement. 1. if statement 2. if...else statement 3. nested if statements 4.switch statement 5. nested switch statements
  • 26. { If Condition in C; }  Syntax If(condition) { Statement..1; Statement..2; Statement..n; }
  • 27. { Simple Program using If Condition in C; }
  • 28. { if else Condition in C; }  Syntax If(condition) { Statement; } Else { Statement; }
  • 29. { Simple Program using If else Condition in C; }
  • 30. { Nested if Condition in C; }  Syntax If(condition) { Statement; if(condition) { Statement; } }
  • 31. { Switch Statement in C; }  Syntax Switch(expression) { Case constant_expression_1: Statement 1; Break; Case constant_expression_2: Statement 2; Break; Case constant_expression_3: Statement 3; Break; Default: Statement 4; }
  • 32. { nested Switch Statement in C; }  Syntax Switch(expression-1) { Case constant_expression_1: Switch(expression-1) { case constant_expression : statement; break; } Break; Case constant_expression_2: Statement 2; Break; Default: Statement 3; }
  • 34. { Types of Loops in C; } 1. while loop 2. for loop 3. do...while loop 4. nested loops
  • 35. { while Loop in C; } Syntax Initialization; While(condition) { Statement..1; Statement..2; Statement..n; increment/decrement; }
  • 36. { A simple Program using While Loop in C; }
  • 37. { for Loop in C; } Syntax for(Initialization;condition; increment/decrement) { Statement..1; Statement..2; Statement..n; }
  • 38. { A simple Program using For Loop in C; }
  • 39. { do while Loop in C; } Syntax Initialization; do { Statement..1; Statement..2; Statement..n; increment/decrement; } While(condition)
  • 40. { A simple Program using Do While Loop in C; }
  • 41. { nested for Loop in C; } Syntax for(Initialization;condition; increment/decrement) { Statement..1; for(Initialization;condition; increment/decrement) { Statement..1; Statement..2; Statement..n; } }
  • 42. { Break Statement in C; } The break statement terminates the loop body immediately and passes control to the next statement after the loop. Break statement are mainly used with loop and switch statement.
  • 43. { A Simple Program Using Break Statement in C; }
  • 44. { Continue Statement in C; } The continue statement in C programming works somewhat like the breakstatement.
  • 45. { A Simple Program Using continue Statement in C; }
  • 46. { Function in C; } Syntax Return_type function_name(argument) { statement; return need_variable; } Example: Int sum(int x,int y) { return x+y; }
  • 47. { Function call in C; } Syntax: Function_name(parameter or argument); Example: 1 #include<stdio.h> 2 int main() 3 { 4 Int z=sum(10,20); 5 printf(z); 6 return 0; 7 }
  • 49. { Types Of Array in C; }
  • 50. { Single Dimensional Array in C; } Syntax data_type array_name [size];
  • 51. { Multi Dimensional Array in C; } Syntax data_type array_name [row_size][column_size];
  • 52. { A simple program using 1D Array in C; }
  • 53. { * Pointer in C; } A pointer is a variable whose value is the address of another variable. Like any variable or constant, you must declare a pointer before using it to store any variable address.
  • 54. { Declaration of Pointer in C; } Syntax data_type *var_name; Example int var = 20; int *ip; ip = &var;
  • 55. { A Simple Program Using Pointer in C; }
  • 56. { File in C; } file is a place on your physical disk where information is stored. Open a File FILE *name; name = fopen(“text.txt","a"); fclose(name);
  • 57. { File in C; } Write in a File FILE *name; name = fopen(“text.txt",“w"); If(name == NULL) { printf(“File Dose Not exist”); } else { for(i = 0; i < 10;i++){ fprintf (fp, "This is line %dn",i + 1); } fclose(name); }
  • 58. { File in C; } Read in a File FILE *name; name = fopen(“text.txt",“w"); Char buff[200]; If(name == NULL) { printf(“File Dose Not exist”); } else { while(fscanf(fp, "%s", buff)!=EOF){ printf("%s ", buff ); } fclose(name); }