SlideShare a Scribd company logo
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

Cnotes
CnotesCnotes
datatypes and variables in c language
 datatypes and variables in c language datatypes and variables in c language
datatypes and variables in c language
Rai University
 
Assignment2
Assignment2Assignment2
Assignment2
Sunita Milind Dol
 
La5 Basicelement
La5 BasicelementLa5 Basicelement
La5 BasicelementCma Mohd
 
Assignment5
Assignment5Assignment5
Assignment5
Sunita Milind Dol
 
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 - declarations
Julian Miglio
 
Flowchart - Introduction and Designing Tools
Flowchart - Introduction and Designing ToolsFlowchart - Introduction and Designing Tools
Flowchart - Introduction and Designing Tools
Jawad Khan
 
Casa lab manual
Casa lab manualCasa lab manual
Casa lab manual
BHARATNIKKAM
 
Handout#09
Handout#09Handout#09
Handout#09
Sunita Milind Dol
 
Variables in C Programming
Variables in C ProgrammingVariables in C Programming
Variables in C Programming
programming9
 
COMPUTER PROGRAMMING
COMPUTER PROGRAMMINGCOMPUTER PROGRAMMING
COMPUTER PROGRAMMING
imtiazalijoono
 
CP Handout#2
CP Handout#2CP Handout#2
CP Handout#2
trupti1976
 
C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III TermAndrew Raj
 
CP Handout#1
CP Handout#1CP Handout#1
CP Handout#1
trupti1976
 
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
Hemantha Kulathilake
 
Complete C programming Language Course
Complete C programming Language CourseComplete C programming Language Course
Complete C programming Language Course
Vivek chan
 
programming fortran 77 Slide01
programming fortran 77 Slide01programming fortran 77 Slide01
programming fortran 77 Slide01
Ahmed Gamal
 
Fortran 90 Basics
Fortran 90 BasicsFortran 90 Basics
Fortran 90 Basics
Tariqul Dipu
 

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.Sivakumar
Sivakumar 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 Function
imtiazalijoono
 
Unit 4 Foc
Unit 4 FocUnit 4 Foc
Unit 4 Foc
JAYA
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
MOHAMAD NOH AHMAD
 
C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)indrasir
 
Chapter3
Chapter3Chapter3
Chapter3
Kamran
 
UNIT-II CP DOC.docx
UNIT-II CP DOC.docxUNIT-II CP DOC.docx
UNIT-II CP DOC.docx
JavvajiVenkat
 
C programing Tutorial
C programing TutorialC programing Tutorial
C programing Tutorial
Mahira Banu
 
Unit 2- Module 2.pptx
Unit 2- Module 2.pptxUnit 2- Module 2.pptx
Unit 2- Module 2.pptx
simranjotsingh2908
 
C programming
C programmingC programming
C programming
PralhadKhanal1
 
unit_2 (1).pptx
unit_2 (1).pptxunit_2 (1).pptx
unit_2 (1).pptx
JVenkateshGoud
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
Vikram Nandini
 
Unit 2 CMath behind coding.pptx
Unit 2 CMath behind coding.pptxUnit 2 CMath behind coding.pptx
Unit 2 CMath behind coding.pptx
PragatheshP
 
java or oops class not in kerala polytechnic 4rth semester nots j
java or oops class not in kerala polytechnic  4rth semester nots jjava or oops class not in kerala polytechnic  4rth semester nots j
java or oops class not in kerala polytechnic 4rth semester nots j
ishorishore
 
Chapter1.pptx
Chapter1.pptxChapter1.pptx
Chapter1.pptx
SREEVIDYAP10
 
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
Pradipta Mishra
 
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
G. H. Raisoni Academy of Engineering & Technology, Nagpur
 
CPU INPUT OUTPUT
CPU INPUT OUTPUT CPU INPUT OUTPUT
CPU INPUT OUTPUT
Aditya Vaishampayan
 
First c program
First c programFirst c program
First c program
Komal Pardeshi
 

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
 
Unit 4 Foc
Unit 4 FocUnit 4 Foc
Unit 4 Foc
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
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
 
java or oops class not in kerala polytechnic 4rth semester nots j
java or oops class not in kerala polytechnic  4rth semester nots jjava or oops class not in kerala polytechnic  4rth semester nots j
java or oops class not in kerala polytechnic 4rth semester nots j
 
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
 

Recently uploaded

Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
Landownership in the Philippines under the Americans-2-pptx.pptx
Landownership in the Philippines under the Americans-2-pptx.pptxLandownership in the Philippines under the Americans-2-pptx.pptx
Landownership in the Philippines under the Americans-2-pptx.pptx
JezreelCabil2
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
AG2 Design
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Ashish Kohli
 

Recently uploaded (20)

Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
Landownership in the Philippines under the Americans-2-pptx.pptx
Landownership in the Philippines under the Americans-2-pptx.pptxLandownership in the Philippines under the Americans-2-pptx.pptx
Landownership in the Philippines under the Americans-2-pptx.pptx
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
 

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.