SlideShare uma empresa Scribd logo
1 de 59
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);

Mais conteúdo relacionado

Mais procurados (20)

Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
Introduction to c++ ppt
Introduction to c++ pptIntroduction to c++ ppt
Introduction to c++ ppt
 
Loops in C Programming Language
Loops in C Programming LanguageLoops in C Programming Language
Loops in C Programming Language
 
C presentation
C presentationC presentation
C presentation
 
Introduction to c++ ppt 1
Introduction to c++ ppt 1Introduction to c++ ppt 1
Introduction to c++ ppt 1
 
FUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPTFUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPT
 
Conditional Statement in C Language
Conditional Statement in C LanguageConditional Statement in C Language
Conditional Statement in C Language
 
Storage class in C Language
Storage class in C LanguageStorage class in C Language
Storage class in C Language
 
Features of c language 1
Features of c language 1Features of c language 1
Features of c language 1
 
Introduction to Basic C programming 01
Introduction to Basic C programming 01Introduction to Basic C programming 01
Introduction to Basic C programming 01
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
 
Operator in c programming
Operator in c programmingOperator in c programming
Operator in c programming
 
C Programming: Control Structure
C Programming: Control StructureC Programming: Control Structure
C Programming: Control Structure
 
C++ language basic
C++ language basicC++ language basic
C++ language basic
 
C++ Overview PPT
C++ Overview PPTC++ Overview PPT
C++ Overview PPT
 
C fundamental
C fundamentalC fundamental
C fundamental
 
OOP in C++
OOP in C++OOP in C++
OOP in C++
 
Structure of a C program
Structure of a C programStructure of a C program
Structure of a C program
 
Loops in c
Loops in cLoops in c
Loops in c
 
Functions in C
Functions in CFunctions in C
Functions in C
 

Semelhante a Programming in C Presentation upto FILE

UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...RSathyaPriyaCSEKIOT
 
Datastructure notes
Datastructure notesDatastructure notes
Datastructure notesSrikanth
 
Ch2 introduction to c
Ch2 introduction to cCh2 introduction to c
Ch2 introduction to cHattori Sidek
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C ProgrammingShuvongkor Barman
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programmingAlpana Gupta
 
An imperative study of c
An imperative study of cAn imperative study of c
An imperative study of cTushar B Kute
 
presentation_c_basics_1589366177_381682.pptx
presentation_c_basics_1589366177_381682.pptxpresentation_c_basics_1589366177_381682.pptx
presentation_c_basics_1589366177_381682.pptxKrishanPalSingh39
 
C prog ppt
C prog pptC prog ppt
C prog pptxinoe
 
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 KumariTHE NORTHCAP UNIVERSITY
 
C decision making and looping.
C decision making and looping.C decision making and looping.
C decision making and looping.Haard Shah
 
C programing Tutorial
C programing TutorialC programing Tutorial
C programing TutorialMahira Banu
 

Semelhante a Programming in C Presentation upto FILE (20)

Programming in C
Programming in CProgramming in C
Programming in C
 
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
 
Basic of C Programming | 2022 Updated | By Shamsul H. Ansari
Basic of C Programming | 2022 Updated | By Shamsul H. AnsariBasic of C Programming | 2022 Updated | By Shamsul H. Ansari
Basic of C Programming | 2022 Updated | By Shamsul H. Ansari
 
Datastructure notes
Datastructure notesDatastructure notes
Datastructure notes
 
Programming in c
Programming in cProgramming in c
Programming in c
 
Ch2 introduction to c
Ch2 introduction to cCh2 introduction to c
Ch2 introduction to c
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C Programming
 
Ppt of c vs c#
Ppt of c vs c#Ppt of c vs c#
Ppt of c vs c#
 
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
 
An imperative study of c
An imperative study of cAn imperative study of c
An imperative study of c
 
presentation_c_basics_1589366177_381682.pptx
presentation_c_basics_1589366177_381682.pptxpresentation_c_basics_1589366177_381682.pptx
presentation_c_basics_1589366177_381682.pptx
 
C fundamentals
C fundamentalsC fundamentals
C fundamentals
 
C Programming Unit-2
C Programming Unit-2C Programming Unit-2
C Programming Unit-2
 
C prog ppt
C prog pptC prog ppt
C prog ppt
 
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
 
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
 
C programming
C programmingC programming
C programming
 
Basics of C porgramming
Basics of C porgrammingBasics of C porgramming
Basics of C porgramming
 

Último

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 

Último (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Programming in C Presentation upto FILE

  • 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); }