SlideShare a Scribd company logo
1 of 13
Instructions are very much similar to sentences/statements in
English language. It is the combination of various tokens,
character set elements to perform a desired task/output to
help a program make it complete.
OR
Instructions in C are the commands in the program that will
instruct C compiler to perform specific tasks or actions.
Whenever we write a C instruction, we are telling C compiler
to do a task for us.
Following are the categories of instructions:
 Declaration instructions
 Input/output instructions
 Assignment instructions
 Arithmetic/logical instructions
 Control instructions
These are used to declare different kind of variable
further to be used by the C program.
Eg:- we want to make a program and declare the variable
suppose, we want to write the area of rectangle. So the
declaration is
int A, B, Area;
OR
int l, b, area;
We want to add two numbers, then the declarations is
int A, B, sum;
Input instructions are used for supplying values to the
variables as declared in declarative instructions.
Eg:- (Statically supplying the values to the variables)
A=10;
B=20;
Where the values of variables are fixed.
(for dynamically supplying the value)
then we use a C library function called scanf( )
output instructions are used for printing the output after the
execution of instructions.
Then we use a C library function called printf( );
These are used for assigning the values in proper order to the
variables.
int A, B, C;
printf(“Enter the first number”);
scanf(“%d”,&A);
printf(“Enter the second number”);
scanf(“%d”,&B);
printf(“Enter the third number”);
scanf(“%d”,&C);
These are used for applying the arithmetic formula or logic to
solve the problems.
Eg:- we need to give a logical instruction to out program
area=l * b;
OR
area = A * B;
These are used to control the flow of execution of the
program.
SR.NO
.
TYPES & DESCRIPTION
1 Basic Types
They are arithmetic types and are further classified into: (a)
integer types and (b) floating-point types.
2 Enumerated types
It is a user defined data type. It gives numbers to the name.
3 The type void
The type especifier void indicates that no value is available.
4 Derived types
They include (a) Pointer types, (b) Array types, (c) Structure
types, (d) Union types (e) Function types.
TYPE SIZE RANGE FORMAT
SPECIFIER
Int or signed int 2 -32768 to 32767 %d,%i
Unsigned int 2 0 to 65535 %u
Short int or signed
short int
1 -128 to 127 %hd
Unsigned short int 1 0 to 255 %hu
Long int or signed
long int
4 -2,147,483,648 to
2,147,483,647
%ld
Unsigned long int 4 0 to 4,294,967,295 %lu
Float 4 3.4E-38 to 3.4E+38 %f
Double 8 1.7E-308 to
1.7E+308
%lf
Long double 10 3.4E-4932 to
1.1E+4932
%Lf or %LF
Char or signed char 1 -128 to 127 %c
Unsigned char 1 0 to 255 %c
#include<stdio.h>
#include<conio.h>
void main( )
{
int A, B, C;
clrscr( );
printf(“Enter the first number-”);
scanf(“%d”,&A);
printf(“Enter the second number-”);
scanf(“%d”,&B);
C=A+B;
printf(“%d”,C);
getch( );
}
Header section
Program execution starts with main( ) function
Declaration section
Clearing the screen function
Assignment section
Arithmetic section
Printing output statement
Take input from keyboard
Body
section
stdio.h
Standard input output header file
This header files contains the definition of standard
Input output functions used by a C program.
Eg:- printf( ); scanf( );
Output Input
conio.h
Console input ouput header file
This header file contains the definition of standard
input output functions used by C program related to
console input output devices.
Eg:- keyboard for input
monitor for output
The function needed for supplying the input data via
keyboard and to get output data via monitor are
defined inside <conio.h> library header file.
clrscr( ); getch( );
Clear the
screen
Get character
void main( )
C compiler starts its compilation from main( ).
Before compilation these is another process known
as pre-processing takes place.
During pre-processing, the header files are to be
declared in this section.
Some important points to be noted while you make any
program
 C program is case sensitive
 All the statements are end with semicolon ( ; )
 You must have to include header files
 Space values are ignored in C.

More Related Content

What's hot

datatypes and variables in c language
 datatypes and variables in c language datatypes and variables in c language
datatypes and variables in c languageRai University
 
La5 Basicelement
La5 BasicelementLa5 Basicelement
La5 BasicelementCma Mohd
 
Ch2 introduction to c
Ch2 introduction to cCh2 introduction to c
Ch2 introduction to cHattori Sidek
 
Modula 2 tutorial - 003 - declarations
Modula 2 tutorial - 003 - declarationsModula 2 tutorial - 003 - declarations
Modula 2 tutorial - 003 - declarationsJulian Miglio
 
Flowchart - Introduction and Designing Tools
Flowchart - Introduction and Designing ToolsFlowchart - Introduction and Designing Tools
Flowchart - Introduction and Designing ToolsJawad Khan
 
Variables in C Programming
Variables in C ProgrammingVariables in C Programming
Variables in C Programmingprogramming9
 
C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III TermAndrew Raj
 
COM1407: Program Control Structures – Decision Making & Branching
COM1407: Program Control Structures – Decision Making & BranchingCOM1407: Program Control Structures – Decision Making & Branching
COM1407: Program Control Structures – Decision Making & BranchingHemantha Kulathilake
 
Complete C programming Language Course
Complete C programming Language CourseComplete C programming Language Course
Complete C programming Language CourseVivek chan
 
programming fortran 77 Slide01
programming fortran 77 Slide01programming fortran 77 Slide01
programming fortran 77 Slide01Ahmed Gamal
 

What's hot (20)

Cnotes
CnotesCnotes
Cnotes
 
datatypes and variables in c language
 datatypes and variables in c language datatypes and variables in c language
datatypes and variables in c language
 
Assignment2
Assignment2Assignment2
Assignment2
 
La5 Basicelement
La5 BasicelementLa5 Basicelement
La5 Basicelement
 
Assignment5
Assignment5Assignment5
Assignment5
 
Ch2 introduction to c
Ch2 introduction to cCh2 introduction to c
Ch2 introduction to c
 
Ch3 repetition
Ch3 repetitionCh3 repetition
Ch3 repetition
 
Modula 2 tutorial - 003 - declarations
Modula 2 tutorial - 003 - declarationsModula 2 tutorial - 003 - declarations
Modula 2 tutorial - 003 - declarations
 
Flowchart - Introduction and Designing Tools
Flowchart - Introduction and Designing ToolsFlowchart - Introduction and Designing Tools
Flowchart - Introduction and Designing Tools
 
Casa lab manual
Casa lab manualCasa lab manual
Casa lab manual
 
Handout#09
Handout#09Handout#09
Handout#09
 
Variables in C Programming
Variables in C ProgrammingVariables in C Programming
Variables in C Programming
 
COMPUTER PROGRAMMING
COMPUTER PROGRAMMINGCOMPUTER PROGRAMMING
COMPUTER PROGRAMMING
 
CP Handout#2
CP Handout#2CP Handout#2
CP Handout#2
 
C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III Term
 
CP Handout#1
CP Handout#1CP Handout#1
CP Handout#1
 
COM1407: Program Control Structures – Decision Making & Branching
COM1407: Program Control Structures – Decision Making & BranchingCOM1407: Program Control Structures – Decision Making & Branching
COM1407: Program Control Structures – Decision Making & Branching
 
Complete C programming Language Course
Complete C programming Language CourseComplete C programming Language Course
Complete C programming Language Course
 
programming fortran 77 Slide01
programming fortran 77 Slide01programming fortran 77 Slide01
programming fortran 77 Slide01
 
Fortran 90 Basics
Fortran 90 BasicsFortran 90 Basics
Fortran 90 Basics
 

Similar to C programming language for beginners

Sample for Simple C Program - R.D.Sivakumar
Sample for Simple C Program - R.D.SivakumarSample for Simple C Program - R.D.Sivakumar
Sample for Simple C Program - R.D.SivakumarSivakumar R D .
 
Fundamental of C Programming Language and Basic Input/Output Function
  Fundamental of C Programming Language and Basic Input/Output Function  Fundamental of C Programming Language and Basic Input/Output Function
Fundamental of C Programming Language and Basic Input/Output Functionimtiazalijoono
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C ProgrammingMOHAMAD NOH AHMAD
 
Unit 4 Foc
Unit 4 FocUnit 4 Foc
Unit 4 FocJAYA
 
C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)indrasir
 
Chapter3
Chapter3Chapter3
Chapter3Kamran
 
C programing Tutorial
C programing TutorialC programing Tutorial
C programing TutorialMahira Banu
 
Unit 2 CMath behind coding.pptx
Unit 2 CMath behind coding.pptxUnit 2 CMath behind coding.pptx
Unit 2 CMath behind coding.pptxPragatheshP
 
Introduction to programming c and data structures
Introduction to programming c and data structuresIntroduction to programming c and data structures
Introduction to programming c and data structuresPradipta Mishra
 
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.pptxAnkitaVerma776806
 

Similar to C programming language for beginners (20)

Sample for Simple C Program - R.D.Sivakumar
Sample for Simple C Program - R.D.SivakumarSample for Simple C Program - R.D.Sivakumar
Sample for Simple C Program - R.D.Sivakumar
 
Fundamental of C Programming Language and Basic Input/Output Function
  Fundamental of C Programming Language and Basic Input/Output Function  Fundamental of C Programming Language and Basic Input/Output Function
Fundamental of C Programming Language and Basic Input/Output Function
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
Unit 4 Foc
Unit 4 FocUnit 4 Foc
Unit 4 Foc
 
C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)
 
Chapter3
Chapter3Chapter3
Chapter3
 
UNIT-II CP DOC.docx
UNIT-II CP DOC.docxUNIT-II CP DOC.docx
UNIT-II CP DOC.docx
 
C programing Tutorial
C programing TutorialC programing Tutorial
C programing Tutorial
 
Unit 2- Module 2.pptx
Unit 2- Module 2.pptxUnit 2- Module 2.pptx
Unit 2- Module 2.pptx
 
C programming
C programmingC programming
C programming
 
C programming
C programmingC programming
C programming
 
unit_2 (1).pptx
unit_2 (1).pptxunit_2 (1).pptx
unit_2 (1).pptx
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
 
Unit 2 CMath behind coding.pptx
Unit 2 CMath behind coding.pptxUnit 2 CMath behind coding.pptx
Unit 2 CMath behind coding.pptx
 
Chapter1.pptx
Chapter1.pptxChapter1.pptx
Chapter1.pptx
 
Introduction to programming c and data structures
Introduction to programming c and data structuresIntroduction to programming c and data structures
Introduction to programming c and data structures
 
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
 
CPU INPUT OUTPUT
CPU INPUT OUTPUT CPU INPUT OUTPUT
CPU INPUT OUTPUT
 
First c program
First c programFirst c program
First c program
 
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
 

Recently uploaded

Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationAadityaSharma884161
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxsqpmdrvczh
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 

Recently uploaded (20)

Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint Presentation
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 

C programming language for beginners

  • 1.
  • 2. Instructions are very much similar to sentences/statements in English language. It is the combination of various tokens, character set elements to perform a desired task/output to help a program make it complete. OR Instructions in C are the commands in the program that will instruct C compiler to perform specific tasks or actions. Whenever we write a C instruction, we are telling C compiler to do a task for us.
  • 3. Following are the categories of instructions:  Declaration instructions  Input/output instructions  Assignment instructions  Arithmetic/logical instructions  Control instructions
  • 4. These are used to declare different kind of variable further to be used by the C program. Eg:- we want to make a program and declare the variable suppose, we want to write the area of rectangle. So the declaration is int A, B, Area; OR int l, b, area; We want to add two numbers, then the declarations is int A, B, sum;
  • 5. Input instructions are used for supplying values to the variables as declared in declarative instructions. Eg:- (Statically supplying the values to the variables) A=10; B=20; Where the values of variables are fixed. (for dynamically supplying the value) then we use a C library function called scanf( ) output instructions are used for printing the output after the execution of instructions. Then we use a C library function called printf( );
  • 6. These are used for assigning the values in proper order to the variables. int A, B, C; printf(“Enter the first number”); scanf(“%d”,&A); printf(“Enter the second number”); scanf(“%d”,&B); printf(“Enter the third number”); scanf(“%d”,&C);
  • 7. These are used for applying the arithmetic formula or logic to solve the problems. Eg:- we need to give a logical instruction to out program area=l * b; OR area = A * B; These are used to control the flow of execution of the program.
  • 8. SR.NO . TYPES & DESCRIPTION 1 Basic Types They are arithmetic types and are further classified into: (a) integer types and (b) floating-point types. 2 Enumerated types It is a user defined data type. It gives numbers to the name. 3 The type void The type especifier void indicates that no value is available. 4 Derived types They include (a) Pointer types, (b) Array types, (c) Structure types, (d) Union types (e) Function types.
  • 9. TYPE SIZE RANGE FORMAT SPECIFIER Int or signed int 2 -32768 to 32767 %d,%i Unsigned int 2 0 to 65535 %u Short int or signed short int 1 -128 to 127 %hd Unsigned short int 1 0 to 255 %hu Long int or signed long int 4 -2,147,483,648 to 2,147,483,647 %ld Unsigned long int 4 0 to 4,294,967,295 %lu Float 4 3.4E-38 to 3.4E+38 %f Double 8 1.7E-308 to 1.7E+308 %lf Long double 10 3.4E-4932 to 1.1E+4932 %Lf or %LF Char or signed char 1 -128 to 127 %c Unsigned char 1 0 to 255 %c
  • 10. #include<stdio.h> #include<conio.h> void main( ) { int A, B, C; clrscr( ); printf(“Enter the first number-”); scanf(“%d”,&A); printf(“Enter the second number-”); scanf(“%d”,&B); C=A+B; printf(“%d”,C); getch( ); } Header section Program execution starts with main( ) function Declaration section Clearing the screen function Assignment section Arithmetic section Printing output statement Take input from keyboard Body section
  • 11. stdio.h Standard input output header file This header files contains the definition of standard Input output functions used by a C program. Eg:- printf( ); scanf( ); Output Input
  • 12. conio.h Console input ouput header file This header file contains the definition of standard input output functions used by C program related to console input output devices. Eg:- keyboard for input monitor for output The function needed for supplying the input data via keyboard and to get output data via monitor are defined inside <conio.h> library header file. clrscr( ); getch( ); Clear the screen Get character
  • 13. void main( ) C compiler starts its compilation from main( ). Before compilation these is another process known as pre-processing takes place. During pre-processing, the header files are to be declared in this section. Some important points to be noted while you make any program  C program is case sensitive  All the statements are end with semicolon ( ; )  You must have to include header files  Space values are ignored in C.