SlideShare una empresa de 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

Más contenido relacionado

La actualidad más candente

La actualidad más candente (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
 

Similar 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
 

Similar 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
 

Más 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
 

Más 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

Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
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
 
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
 
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 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
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
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
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
 
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
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 

Último (20)

Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
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
 
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...
 
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 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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 Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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
 
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
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 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