SlideShare uma empresa Scribd logo
1 de 31
STRUCTURE
OF
‘C’ PROGRAM
‘C’ Program is a collection of
one or more function, Every
function is a collection of
statement perform some
specific task.
//comment
preprocessor directive
global variables
main()
{
local variable
statements
}
function1()
{
local variable
statements
}
function2()
{
local variable
statements
}
.
.
functionN()
{
local variable
statements
}
• Comments can be place anywhere in a
program and are enclose between the
delimiters.
• Comments are generally used for
documentation. Comments ignore by
compiler.
Comments are-
i) Single line comments
ii) Multi-line comments
//ADDITION PROGRAM
#include<stdio.h>
#include<conio.h>
void main()
{
int a=5,b=6;
printf(“%d + %d = %d”,a,b,(a+));
getch();
}
/* ADDITION PROGRAM
this is multi-line comment
all three lines ignore by compiler */
#include<stdio.h>
#include<conio.h>
void main()
{
int a=5,b=6;
printf(“%d + %d = %d”,a,b,(a+));
getch();
}
Preprocessor directives are process through
preprocessor before the ‘C’ Source code passes
through compiler.
the commonly used preprocessor directives are-
#include and #define
* the #include is used for including the
header files.
* the # define is used to define symbolic
constant and macros.
Commonly used header files in #include preprocessor
directives are-
#include<stdio.h>
#include<conio.h>
These header files are used by the beginners and the
programmers.
# is a special symbol which is requested to compiler.
The nature of # is to request, which is used to request for the
compiler for the specific work.
For example- in mobiles-*123# if we include # with any number
then it run a USSD code or request.
If we not use # then with any number calling start.
You can try-
Dial any number with * and # in mobile then you find a code
running, it doesn’t make a call, it request.
Dial- *2345# or Dial- *12345* you find the difference.
* Now include means to include something
* Include means – add, insert or put in etc.
*Means that # request to include something.
* The something is <stdio.h> header file.
* Stdio.h means std stands for standard, io stands for
input output, and .h is the extension of header file.
Means that #include<stdio.h> is the preprocessor
directive which requests to include/add/ insert the
standard input output header file.
printf(); // used to print statements
scanf(); //used to get input from user
These are the basic function which is
used for beginner of the ‘C’
Programming.
The alternate also available of these
functions, it will discuss later.
The work of #include is same, but the <conio.h> is
differ from the <stdio.h>
conio.h stands for console input output header file.
Function of <conio.h>
clrscr(); // to clear output screen
getch(); // to hold the output screen
conio.h is basically work for the output screen.
ankushrghv@gmail.com
 Every ‘C’ Program has one or more
functions.
 If a program has only ONE Function then
it must be main().
 Execution of every ‘C’ program start with
main() function. It has two part,
declaration of local variables and
statements.
 The scope of the local variables to that
function only.
 Statements in the main() function are
executed one by one.
 Library Function
(also called built-in function.
Eg- scanf(), printf(), gets(), puts() etc.)
 User-Defined Functions
(these are the functions
which are created by the C
Programmer)
1. Function Declaration
2. Function Definition
3. Function Calling
return type function name();
void add(int a, int b);
SYNTAX-
EXAMPLE
-
return type function name()
{
Function body;
}
void add(int a, int b)
{
printf(“add function with parameter”);
}
SYNTAX-
EXAMPLE
-
Function Definition
function_name();
void add(5,7);
SYNTAX-
EXAMPLE
-
 The characters that are used in ‘C’ Program
are ‘C’ Character set. Which are given below-
 Alphabets- A,B,C,D,E,…………………..Z
a,b,c,d,e,f,……………………z
 Digits- 0,1,2,3,4,5,6,7,8,9
 Special character
Symbols Name Symbols Name Symbols Name
+ Plus ) Right
parenthesis
? Question
Mark
* Astrisk { Left curly
braces
& Ampersand
 Backward slash } Right curly
braces
@ At the rate
/ Forward slash [ Left bracket $ Dollar sign
< Less than ] Right Bracket ` Tilde sign
> Greater than , Comma - Minus,
Hyphen
( Left parenthesis : Colon % Percentage
= Equal sign ; Semi-colon | Vertical bar
. Period ‘ ‘ Single
Quotes
^ Caveat sign
“ “ Double quotes ! Exclamation # Hash
ankushrghv@gmail.com

Mais conteúdo relacionado

Mais procurados (20)

Programming Fundamentals Functions in C and types
Programming Fundamentals  Functions in C  and typesProgramming Fundamentals  Functions in C  and types
Programming Fundamentals Functions in C and types
 
Built in function
Built in functionBuilt in function
Built in function
 
Function in c
Function in cFunction in c
Function in c
 
Lesson 7 io statements
Lesson 7 io statementsLesson 7 io statements
Lesson 7 io statements
 
Basic structure of c programming
Basic structure of c programmingBasic structure of c programming
Basic structure of c programming
 
Functions in c
Functions in cFunctions in c
Functions in c
 
Functions in C
Functions in CFunctions in C
Functions in C
 
User defined functions in C
User defined functions in CUser defined functions in C
User defined functions in C
 
Functions in c
Functions in cFunctions in c
Functions in c
 
User defined functions in C programmig
User defined functions in C programmigUser defined functions in C programmig
User defined functions in C programmig
 
Header files in c
Header files in cHeader files in c
Header files in c
 
user defined function
user defined functionuser defined function
user defined function
 
Functions in C - Programming
Functions in C - Programming Functions in C - Programming
Functions in C - Programming
 
Function lecture
Function lectureFunction lecture
Function lecture
 
FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM)
 FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM) FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM)
FUNCTION IN C PROGRAMMING UNIT -6 (BCA I SEM)
 
Function in c
Function in cFunction in c
Function in c
 
Function in c program
Function in c programFunction in c program
Function in c program
 
Function in C Language
Function in C Language Function in C Language
Function in C Language
 
c++ programming Unit 2 basic structure of a c++ program
c++ programming Unit 2 basic structure of a c++ programc++ programming Unit 2 basic structure of a c++ program
c++ programming Unit 2 basic structure of a c++ program
 
C functions
C functionsC functions
C functions
 

Semelhante a C structure

Chapter 1_C Fundamentals_HS_Tech Yourself C.pptx
Chapter 1_C Fundamentals_HS_Tech Yourself C.pptxChapter 1_C Fundamentals_HS_Tech Yourself C.pptx
Chapter 1_C Fundamentals_HS_Tech Yourself C.pptxssuser71a90c
 
Programming Fundamentals lecture 5
Programming Fundamentals lecture 5Programming Fundamentals lecture 5
Programming Fundamentals lecture 5REHAN IJAZ
 
Basics of c Nisarg Patel
Basics of c Nisarg PatelBasics of c Nisarg Patel
Basics of c Nisarg PatelTechNGyan
 
C notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-semC notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-semKavita Dagar
 
Presentation on C language By Kirtika thakur
Presentation on C language By Kirtika thakurPresentation on C language By Kirtika thakur
Presentation on C language By Kirtika thakurThakurkirtika
 
Basic structure of c programming
Basic structure of c programmingBasic structure of c programming
Basic structure of c programmingTejaswiB4
 
unit3 part2 pcds function notes.pdf
unit3 part2 pcds function notes.pdfunit3 part2 pcds function notes.pdf
unit3 part2 pcds function notes.pdfJAVVAJI VENKATA RAO
 
Functions assignment
Functions assignmentFunctions assignment
Functions assignmentAhmad Kamal
 
Unit 2 CMath behind coding.pptx
Unit 2 CMath behind coding.pptxUnit 2 CMath behind coding.pptx
Unit 2 CMath behind coding.pptxPragatheshP
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAAiman Hud
 

Semelhante a C structure (20)

Chapter 1_C Fundamentals_HS_Tech Yourself C.pptx
Chapter 1_C Fundamentals_HS_Tech Yourself C.pptxChapter 1_C Fundamentals_HS_Tech Yourself C.pptx
Chapter 1_C Fundamentals_HS_Tech Yourself C.pptx
 
unit_2 (1).pptx
unit_2 (1).pptxunit_2 (1).pptx
unit_2 (1).pptx
 
unit_2.pptx
unit_2.pptxunit_2.pptx
unit_2.pptx
 
Cpp
CppCpp
Cpp
 
Programming Fundamentals lecture 5
Programming Fundamentals lecture 5Programming Fundamentals lecture 5
Programming Fundamentals lecture 5
 
Basics of c Nisarg Patel
Basics of c Nisarg PatelBasics of c Nisarg Patel
Basics of c Nisarg Patel
 
C++ Constructs.pptx
C++ Constructs.pptxC++ Constructs.pptx
C++ Constructs.pptx
 
C notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-semC notes diploma-ee-3rd-sem
C notes diploma-ee-3rd-sem
 
Presentation on C language By Kirtika thakur
Presentation on C language By Kirtika thakurPresentation on C language By Kirtika thakur
Presentation on C language By Kirtika thakur
 
Basic structure of c programming
Basic structure of c programmingBasic structure of c programming
Basic structure of c programming
 
Unit 3 (1)
Unit 3 (1)Unit 3 (1)
Unit 3 (1)
 
Programming in C
Programming in CProgramming in C
Programming in C
 
C Programming Tutorial - www.infomtec.com
C Programming Tutorial - www.infomtec.comC Programming Tutorial - www.infomtec.com
C Programming Tutorial - www.infomtec.com
 
unit3 part2 pcds function notes.pdf
unit3 part2 pcds function notes.pdfunit3 part2 pcds function notes.pdf
unit3 part2 pcds function notes.pdf
 
CC 3 - Module 2.pdf
CC 3 - Module 2.pdfCC 3 - Module 2.pdf
CC 3 - Module 2.pdf
 
Functions assignment
Functions assignmentFunctions assignment
Functions assignment
 
Unit 2 CMath behind coding.pptx
Unit 2 CMath behind coding.pptxUnit 2 CMath behind coding.pptx
Unit 2 CMath behind coding.pptx
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
C FUNCTIONS
C FUNCTIONSC FUNCTIONS
C FUNCTIONS
 
C programming
C programmingC programming
C programming
 

Mais de ankush9927

Cell - Animal/plant
Cell - Animal/plantCell - Animal/plant
Cell - Animal/plantankush9927
 
Part of speech
Part of speechPart of speech
Part of speechankush9927
 
PART OF SPEECH
PART OF SPEECHPART OF SPEECH
PART OF SPEECHankush9927
 
Parts Of Speech
Parts Of SpeechParts Of Speech
Parts Of Speechankush9927
 
Himanshu Chaudhary class 9th.pptx
Himanshu Chaudhary class 9th.pptxHimanshu Chaudhary class 9th.pptx
Himanshu Chaudhary class 9th.pptxankush9927
 
Number system part 2
Number system part 2Number system part 2
Number system part 2ankush9927
 
Identifier in c
Identifier in cIdentifier in c
Identifier in cankush9927
 
Theprisonsystemxtracredit 120426084243-phpapp01
Theprisonsystemxtracredit 120426084243-phpapp01Theprisonsystemxtracredit 120426084243-phpapp01
Theprisonsystemxtracredit 120426084243-phpapp01ankush9927
 
Introduction to networks11
Introduction to networks11Introduction to networks11
Introduction to networks11ankush9927
 

Mais de ankush9927 (13)

Cell - Animal/plant
Cell - Animal/plantCell - Animal/plant
Cell - Animal/plant
 
Part of speech
Part of speechPart of speech
Part of speech
 
PART OF SPEECH
PART OF SPEECHPART OF SPEECH
PART OF SPEECH
 
Parts Of Speech
Parts Of SpeechParts Of Speech
Parts Of Speech
 
Himanshu Chaudhary class 9th.pptx
Himanshu Chaudhary class 9th.pptxHimanshu Chaudhary class 9th.pptx
Himanshu Chaudhary class 9th.pptx
 
Number system
Number systemNumber system
Number system
 
Number system part 2
Number system part 2Number system part 2
Number system part 2
 
Operator in c
Operator in cOperator in c
Operator in c
 
Identifier in c
Identifier in cIdentifier in c
Identifier in c
 
History of c
History of cHistory of c
History of c
 
Topology
TopologyTopology
Topology
 
Theprisonsystemxtracredit 120426084243-phpapp01
Theprisonsystemxtracredit 120426084243-phpapp01Theprisonsystemxtracredit 120426084243-phpapp01
Theprisonsystemxtracredit 120426084243-phpapp01
 
Introduction to networks11
Introduction to networks11Introduction to networks11
Introduction to networks11
 

Último

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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
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
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Último (20)

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, ...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

C structure

  • 1.
  • 3. ‘C’ Program is a collection of one or more function, Every function is a collection of statement perform some specific task.
  • 4. //comment preprocessor directive global variables main() { local variable statements } function1() { local variable statements } function2() { local variable statements } . . functionN() { local variable statements }
  • 5.
  • 6. • Comments can be place anywhere in a program and are enclose between the delimiters. • Comments are generally used for documentation. Comments ignore by compiler. Comments are- i) Single line comments ii) Multi-line comments
  • 7. //ADDITION PROGRAM #include<stdio.h> #include<conio.h> void main() { int a=5,b=6; printf(“%d + %d = %d”,a,b,(a+)); getch(); }
  • 8. /* ADDITION PROGRAM this is multi-line comment all three lines ignore by compiler */ #include<stdio.h> #include<conio.h> void main() { int a=5,b=6; printf(“%d + %d = %d”,a,b,(a+)); getch(); }
  • 9.
  • 10. Preprocessor directives are process through preprocessor before the ‘C’ Source code passes through compiler. the commonly used preprocessor directives are- #include and #define * the #include is used for including the header files. * the # define is used to define symbolic constant and macros.
  • 11. Commonly used header files in #include preprocessor directives are- #include<stdio.h> #include<conio.h> These header files are used by the beginners and the programmers.
  • 12. # is a special symbol which is requested to compiler. The nature of # is to request, which is used to request for the compiler for the specific work. For example- in mobiles-*123# if we include # with any number then it run a USSD code or request. If we not use # then with any number calling start. You can try- Dial any number with * and # in mobile then you find a code running, it doesn’t make a call, it request. Dial- *2345# or Dial- *12345* you find the difference.
  • 13. * Now include means to include something * Include means – add, insert or put in etc. *Means that # request to include something. * The something is <stdio.h> header file. * Stdio.h means std stands for standard, io stands for input output, and .h is the extension of header file. Means that #include<stdio.h> is the preprocessor directive which requests to include/add/ insert the standard input output header file.
  • 14. printf(); // used to print statements scanf(); //used to get input from user These are the basic function which is used for beginner of the ‘C’ Programming. The alternate also available of these functions, it will discuss later.
  • 15. The work of #include is same, but the <conio.h> is differ from the <stdio.h> conio.h stands for console input output header file. Function of <conio.h> clrscr(); // to clear output screen getch(); // to hold the output screen conio.h is basically work for the output screen.
  • 16.
  • 17.
  • 18.
  • 20.
  • 21.
  • 22.  Every ‘C’ Program has one or more functions.  If a program has only ONE Function then it must be main().  Execution of every ‘C’ program start with main() function. It has two part, declaration of local variables and statements.  The scope of the local variables to that function only.  Statements in the main() function are executed one by one.
  • 23.  Library Function (also called built-in function. Eg- scanf(), printf(), gets(), puts() etc.)  User-Defined Functions (these are the functions which are created by the C Programmer)
  • 24. 1. Function Declaration 2. Function Definition 3. Function Calling
  • 25. return type function name(); void add(int a, int b); SYNTAX- EXAMPLE -
  • 26. return type function name() { Function body; } void add(int a, int b) { printf(“add function with parameter”); } SYNTAX- EXAMPLE - Function Definition
  • 28.
  • 29.  The characters that are used in ‘C’ Program are ‘C’ Character set. Which are given below-  Alphabets- A,B,C,D,E,…………………..Z a,b,c,d,e,f,……………………z  Digits- 0,1,2,3,4,5,6,7,8,9  Special character
  • 30. Symbols Name Symbols Name Symbols Name + Plus ) Right parenthesis ? Question Mark * Astrisk { Left curly braces & Ampersand Backward slash } Right curly braces @ At the rate / Forward slash [ Left bracket $ Dollar sign < Less than ] Right Bracket ` Tilde sign > Greater than , Comma - Minus, Hyphen ( Left parenthesis : Colon % Percentage = Equal sign ; Semi-colon | Vertical bar . Period ‘ ‘ Single Quotes ^ Caveat sign “ “ Double quotes ! Exclamation # Hash