SlideShare a Scribd company logo
By
Y.Sai Sruthi,
15471A0495
Pre-processor statements
Global variable declaration section
Void main()
{
Local variable declaration section
<statements>
}
Void sub-function()
{
Local variable declaration section
<statements>
}
 These are the statements which can be executed
before the program starts execution.
 This can be executed in the compile time.
 Compile time=compilation+linking.
 Example:
#define
#undefine
#include
#if
#end if
#else
 This is the 1st part of c code.
 C language is a set of small small functions.
 Let us take 3 functions in a c code.
 The first function stores an integer value i.e
a=10.
 So it can’t be used in remaining functions
then it is called local variable.we define them
at local variable declaration section.
 But if we want to use a value througout all the
program then it should be declared at global
variable declaration section and is called
global variable
 It is the main function of a c code
 Every c program consists of only one main
function.
 C program is a collection of many functions.
 The first function we define is main function
and remaining all are sub functions.
 This is the 3rd part of a c code.
 To open any function we specify {.
 That means the function gets opened.
 To close any function we write}.
 This closes the function.
 We can write the statements in c in this
statements block.
 The c code consists of many number of sub
functions if we need.
 Soo we start the function ,we open,we declare
local variables ,we state and we close the
subfunction.
thank you

More Related Content

PPTX
Pointers.pptx
PPT
Preprocessor in C
PPTX
User defined data types.pptx
PPT
Standard Library Functions
PPTX
C Programming: Basic Structure of C Program
PPT
Basic structure of C++ program
PPTX
Structure of C program
PPT
C Language
Pointers.pptx
Preprocessor in C
User defined data types.pptx
Standard Library Functions
C Programming: Basic Structure of C Program
Basic structure of C++ program
Structure of C program
C Language

What's hot (20)

PPT
Structure in c
PPTX
Looping Statement And Flow Chart
PPTX
C Structures and Unions
PDF
C Pointers
PPTX
Presentation1
PPTX
Loops in c
PPT
pre processor directives in C
PDF
Function in C
PDF
C programming notes
PPT
Preprocessors
PPT
OOP in C++
DOCX
Structure and Typedef
PDF
SAP - COURS.pdf
PPTX
Variables in C++, data types in c++
PDF
Learn C# Programming - Data Types & Type Conversion
PDF
Unit II chapter 4 Loops in C
PDF
Manipulators
PDF
Pointers in C
PPTX
Switch statement, break statement, go to statement
Structure in c
Looping Statement And Flow Chart
C Structures and Unions
C Pointers
Presentation1
Loops in c
pre processor directives in C
Function in C
C programming notes
Preprocessors
OOP in C++
Structure and Typedef
SAP - COURS.pdf
Variables in C++, data types in c++
Learn C# Programming - Data Types & Type Conversion
Unit II chapter 4 Loops in C
Manipulators
Pointers in C
Switch statement, break statement, go to statement
Ad

Similar to structure of a c program (20)

PPTX
formofacprogram-180106145347.pptx
DOCX
C language function
PDF
Cp week _2.
PPTX
Overview of C Mrs Sowmya Jyothi
DOC
Project two c++ tutorial
DOC
Basic construction of c
PDF
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
PPTX
Unit-III.pptx
PPTX
Programming in C FUNCTION Basic concepts.pptx
PDF
Book management system
PDF
C programming course material
PDF
Functions-Computer programming
PPTX
Lecture_5_-_Functions_in_C_Detailed.pptx
PPT
Chapter 1.ppt
DOCX
Apa style-1 (1)
PPTX
User Defined Functionscccccccccccccccccccccccccc.pptx
PDF
All chapters C++ - Copy.pdfyttttttttttttttttttttttttttttt
PDF
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
PDF
unit3 part2 pcds function notes.pdf
PPTX
structured Programming Unit-7-Functions.pptx
formofacprogram-180106145347.pptx
C language function
Cp week _2.
Overview of C Mrs Sowmya Jyothi
Project two c++ tutorial
Basic construction of c
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
Unit-III.pptx
Programming in C FUNCTION Basic concepts.pptx
Book management system
C programming course material
Functions-Computer programming
Lecture_5_-_Functions_in_C_Detailed.pptx
Chapter 1.ppt
Apa style-1 (1)
User Defined Functionscccccccccccccccccccccccccc.pptx
All chapters C++ - Copy.pdfyttttttttttttttttttttttttttttt
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
unit3 part2 pcds function notes.pdf
structured Programming Unit-7-Functions.pptx
Ad

Recently uploaded (20)

PPTX
UNIT 4 Total Quality Management .pptx
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPTX
OOP with Java - Java Introduction (Basics)
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
Sustainable Sites - Green Building Construction
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPT
Mechanical Engineering MATERIALS Selection
PDF
PPT on Performance Review to get promotions
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
additive manufacturing of ss316l using mig welding
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
Geodesy 1.pptx...............................................
PDF
Digital Logic Computer Design lecture notes
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
UNIT 4 Total Quality Management .pptx
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Automation-in-Manufacturing-Chapter-Introduction.pdf
OOP with Java - Java Introduction (Basics)
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Sustainable Sites - Green Building Construction
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Mechanical Engineering MATERIALS Selection
PPT on Performance Review to get promotions
R24 SURVEYING LAB MANUAL for civil enggi
additive manufacturing of ss316l using mig welding
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Internet of Things (IOT) - A guide to understanding
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
bas. eng. economics group 4 presentation 1.pptx
Geodesy 1.pptx...............................................
Digital Logic Computer Design lecture notes
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...

structure of a c program

  • 2. Pre-processor statements Global variable declaration section Void main() { Local variable declaration section <statements> } Void sub-function() { Local variable declaration section <statements> }
  • 3.  These are the statements which can be executed before the program starts execution.  This can be executed in the compile time.  Compile time=compilation+linking.  Example: #define #undefine #include #if #end if #else  This is the 1st part of c code.
  • 4.  C language is a set of small small functions.  Let us take 3 functions in a c code.  The first function stores an integer value i.e a=10.  So it can’t be used in remaining functions then it is called local variable.we define them at local variable declaration section.  But if we want to use a value througout all the program then it should be declared at global variable declaration section and is called global variable
  • 5.  It is the main function of a c code  Every c program consists of only one main function.  C program is a collection of many functions.  The first function we define is main function and remaining all are sub functions.  This is the 3rd part of a c code.
  • 6.  To open any function we specify {.  That means the function gets opened.  To close any function we write}.  This closes the function.
  • 7.  We can write the statements in c in this statements block.
  • 8.  The c code consists of many number of sub functions if we need.  Soo we start the function ,we open,we declare local variables ,we state and we close the subfunction.