SlideShare a Scribd company logo
1 of 22
Basic C Structure and
related terms with
example
Sanjida Alam
163-15-8275
What is c programming?
C has now become a widely used professional language for various reasons:
Easy to learn.
Structured language.
It produces efficient programs .
It can handle low-level activities.
It can be compiled on a variety of computer platforms.
Importance of Programming & Problem
Solving
• Here are some of the things that learning coding can empower someone to do-
• To Make someone’s Own Website.
• Become a Career Coder.
• Start a Business
• Some of the kinds of businesses you can start include…
selling software
selling mobile apps
e-commerce
selling your coding time.
To Understand How Computers Work and so more.
Hello
Nahian Kabir
163-15-8547
HEADER FILE
• A header file is a file with extension .h which contains C function declarations .
• There are two types of header files :
Files that the programmer writes and
Files that comes with a compiler.
• For Example:
stdio.h header file contains standard Input and Output functions.
string.h header file contains string handling functions.
Main function
• main() function is the entry point of any C program;
• It is the point at which execution of program is started;
• When a C program is executed, the execution control goes directly to the
main() function.
• Every C program have a main() function.
• It’s a compulsory for c program.
Simple example of a
program
RUBAYET AHMED
163-15-8459
Program Structure
• A sample of c program-
#include<stdio.h>
int main()
{
-----Statements----
// comments after double slash
}
Running a program
Comments in c
• A comment is a programmer-readable explanation;
• They are added with the purpose of making the source code easier for humans to understand,
and are generally ignored by compilers and interpreters.
• Example-
• Single line comment-
//(double slash);
Multiline comment-
/*---------
------*/
• This can span over to multiple line;
Keywords in C Language
variables
• Variables are data that will keep on changing. A variable is nothing but a name given to a
storage area that our programs can manipulate.
• Declaration
<<Data type>> <<variable name>>;
int a;
• Definition
<<varname>>=<<value>>;
a=10;
• Usage
<<varname>> I
a=a+1; //increments the value of a by 1
Variable names-Rules
Sanjana Mun
163-15-8443
Constants
• Constants refer to fixed values that the program may not alter during its
execution. These fixed values are also called literals.
• Given below is the form to use #define preprocessor to define a
• constant −
• #define identifier value
Input Output
INPUT
-scanf(“%d”,&a);
-gets an integer value from the user and stores it under the name ‘a’
Output
-printf (“%d”,a);
-print the value present in variable a on the screen
c operators
Thanks!
Any question?

More Related Content

What's hot

C programming presentation for university
C programming presentation for universityC programming presentation for university
C programming presentation for universitySheikh Monirul Hasan
 
Notes of c programming 1st unit BCA I SEM
Notes of c programming  1st unit BCA I SEMNotes of c programming  1st unit BCA I SEM
Notes of c programming 1st unit BCA I SEMMansi Tyagi
 
Programming Fundamentals and basic knowledge
Programming Fundamentals and basic knowledge Programming Fundamentals and basic knowledge
Programming Fundamentals and basic knowledge imtiazalijoono
 
Programming content
Programming contentProgramming content
Programming contentBazlin Ahmad
 
Chapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to ProgrammingChapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to Programmingmshellman
 
Programming introduction
Programming introductionProgramming introduction
Programming introductionExplore Skilled
 
Overview of language processor sp
Overview of language processor spOverview of language processor sp
Overview of language processor spravinlaheri2
 
Computer programming chapter ( 3 )
Computer programming chapter ( 3 ) Computer programming chapter ( 3 )
Computer programming chapter ( 3 ) Ibrahim Elewah
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer ProgrammingProf. Erwin Globio
 
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTTC programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTTBatra Centre
 
Compiler - Computer Programming - UOZ
Compiler - Computer Programming - UOZ Compiler - Computer Programming - UOZ
Compiler - Computer Programming - UOZ Safen D Taha
 
C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)indrasir
 

What's hot (20)

Presentation on C programming language
Presentation on C programming languagePresentation on C programming language
Presentation on C programming language
 
C programming presentation for university
C programming presentation for universityC programming presentation for university
C programming presentation for university
 
Notes of c programming 1st unit BCA I SEM
Notes of c programming  1st unit BCA I SEMNotes of c programming  1st unit BCA I SEM
Notes of c programming 1st unit BCA I SEM
 
Programming Fundamentals and basic knowledge
Programming Fundamentals and basic knowledge Programming Fundamentals and basic knowledge
Programming Fundamentals and basic knowledge
 
Programming content
Programming contentProgramming content
Programming content
 
Chapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to ProgrammingChapter 1 - An Introduction to Programming
Chapter 1 - An Introduction to Programming
 
Programming introduction
Programming introductionProgramming introduction
Programming introduction
 
Unit4
Unit4Unit4
Unit4
 
Overview of language processor sp
Overview of language processor spOverview of language processor sp
Overview of language processor sp
 
Book ppt
Book pptBook ppt
Book ppt
 
Computer programming chapter ( 3 )
Computer programming chapter ( 3 ) Computer programming chapter ( 3 )
Computer programming chapter ( 3 )
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer Programming
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTTC programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
C programming notes BATRACOMPUTER CENTRE IN Ambala CANTT
 
Compiler - Computer Programming - UOZ
Compiler - Computer Programming - UOZ Compiler - Computer Programming - UOZ
Compiler - Computer Programming - UOZ
 
Computer
ComputerComputer
Computer
 
Abc c program
Abc c programAbc c program
Abc c program
 
Lesson 1 introduction to programming
Lesson 1 introduction to programmingLesson 1 introduction to programming
Lesson 1 introduction to programming
 
C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)
 
Lec 1 intro
Lec 1 introLec 1 intro
Lec 1 intro
 

Similar to Basic C Structure and related terms with example

Basic Structure of C Language and Related Term
Basic Structure of C Language  and Related TermBasic Structure of C Language  and Related Term
Basic Structure of C Language and Related TermMuhammadWaseem305
 
Unit-1 (introduction to c language).pptx
Unit-1 (introduction to c language).pptxUnit-1 (introduction to c language).pptx
Unit-1 (introduction to c language).pptxsaivasu4
 
Understanding C and its Applications.pdf
Understanding C and its Applications.pdfUnderstanding C and its Applications.pdf
Understanding C and its Applications.pdfAdeleHansley
 
490450755-Chapter-2.ppt
490450755-Chapter-2.ppt490450755-Chapter-2.ppt
490450755-Chapter-2.pptManiMala75
 
490450755-Chapter-2.ppt
490450755-Chapter-2.ppt490450755-Chapter-2.ppt
490450755-Chapter-2.pptManiMala75
 
Chapter-2 edited on Programming in Can refer this ppt
Chapter-2 edited on Programming in Can refer this pptChapter-2 edited on Programming in Can refer this ppt
Chapter-2 edited on Programming in Can refer this pptANISHYAPIT
 
Introduction to the c programming language (amazing and easy book for beginners)
Introduction to the c programming language (amazing and easy book for beginners)Introduction to the c programming language (amazing and easy book for beginners)
Introduction to the c programming language (amazing and easy book for beginners)mujeeb memon
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programmingMalikaJoya
 
C Programming UNIT 1.pptx
C Programming  UNIT 1.pptxC Programming  UNIT 1.pptx
C Programming UNIT 1.pptxMugilvannan11
 
05 Lecture - PARALLEL Programming in C ++.pdf
05 Lecture - PARALLEL Programming in C ++.pdf05 Lecture - PARALLEL Programming in C ++.pdf
05 Lecture - PARALLEL Programming in C ++.pdfalivaisi1
 

Similar to Basic C Structure and related terms with example (20)

Basic Structure of C Language and Related Term
Basic Structure of C Language  and Related TermBasic Structure of C Language  and Related Term
Basic Structure of C Language and Related Term
 
C session 1.pptx
C session 1.pptxC session 1.pptx
C session 1.pptx
 
Unit-1 (introduction to c language).pptx
Unit-1 (introduction to c language).pptxUnit-1 (introduction to c language).pptx
Unit-1 (introduction to c language).pptx
 
Understanding C and its Applications.pdf
Understanding C and its Applications.pdfUnderstanding C and its Applications.pdf
Understanding C and its Applications.pdf
 
Structure
StructureStructure
Structure
 
C programming
C programming C programming
C programming
 
C language unit-1
C language unit-1C language unit-1
C language unit-1
 
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDYC LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
C LANGUAGE UNIT-1 PREPARED BY M V BRAHMANANDA REDDY
 
C languaGE UNIT-1
C languaGE UNIT-1C languaGE UNIT-1
C languaGE UNIT-1
 
490450755-Chapter-2.ppt
490450755-Chapter-2.ppt490450755-Chapter-2.ppt
490450755-Chapter-2.ppt
 
490450755-Chapter-2.ppt
490450755-Chapter-2.ppt490450755-Chapter-2.ppt
490450755-Chapter-2.ppt
 
Learning the C Language
Learning the C LanguageLearning the C Language
Learning the C Language
 
Chapter-2 edited on Programming in Can refer this ppt
Chapter-2 edited on Programming in Can refer this pptChapter-2 edited on Programming in Can refer this ppt
Chapter-2 edited on Programming in Can refer this ppt
 
Rr
RrRr
Rr
 
Introduction to the c programming language (amazing and easy book for beginners)
Introduction to the c programming language (amazing and easy book for beginners)Introduction to the c programming language (amazing and easy book for beginners)
Introduction to the c programming language (amazing and easy book for beginners)
 
C pdf
C pdfC pdf
C pdf
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
 
Prog1-L1.pdf
Prog1-L1.pdfProg1-L1.pdf
Prog1-L1.pdf
 
C Programming UNIT 1.pptx
C Programming  UNIT 1.pptxC Programming  UNIT 1.pptx
C Programming UNIT 1.pptx
 
05 Lecture - PARALLEL Programming in C ++.pdf
05 Lecture - PARALLEL Programming in C ++.pdf05 Lecture - PARALLEL Programming in C ++.pdf
05 Lecture - PARALLEL Programming in C ++.pdf
 

More from sanjana mun

Tech aware website design
Tech aware website designTech aware website design
Tech aware website designsanjana mun
 
Adaptation & Personalization of web application
Adaptation & Personalization of web applicationAdaptation & Personalization of web application
Adaptation & Personalization of web applicationsanjana mun
 
Impact of TV and video games on childrens
Impact of TV and video games on childrensImpact of TV and video games on childrens
Impact of TV and video games on childrenssanjana mun
 
Tools for system analysis
Tools for system analysisTools for system analysis
Tools for system analysissanjana mun
 
Network topologies
Network topologiesNetwork topologies
Network topologiessanjana mun
 
Cyber crime and security
Cyber crime and securityCyber crime and security
Cyber crime and securitysanjana mun
 
Electrical circuit verification of K irchhoff’s Current Law(KCL) & Current di...
Electrical circuit verification of K irchhoff’s Current Law(KCL) & Current di...Electrical circuit verification of K irchhoff’s Current Law(KCL) & Current di...
Electrical circuit verification of K irchhoff’s Current Law(KCL) & Current di...sanjana mun
 
Application's of Numerical Math in CSE
Application's of Numerical Math in CSEApplication's of Numerical Math in CSE
Application's of Numerical Math in CSEsanjana mun
 
Road accident and student's protest at Bangladesh
Road accident and student's protest  at Bangladesh Road accident and student's protest  at Bangladesh
Road accident and student's protest at Bangladesh sanjana mun
 

More from sanjana mun (13)

Tech aware website design
Tech aware website designTech aware website design
Tech aware website design
 
Adaptation & Personalization of web application
Adaptation & Personalization of web applicationAdaptation & Personalization of web application
Adaptation & Personalization of web application
 
Impact of TV and video games on childrens
Impact of TV and video games on childrensImpact of TV and video games on childrens
Impact of TV and video games on childrens
 
Fragmentaton
Fragmentaton Fragmentaton
Fragmentaton
 
Tools for system analysis
Tools for system analysisTools for system analysis
Tools for system analysis
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
Network topologies
Network topologiesNetwork topologies
Network topologies
 
Cyber crime and security
Cyber crime and securityCyber crime and security
Cyber crime and security
 
Electrical circuit verification of K irchhoff’s Current Law(KCL) & Current di...
Electrical circuit verification of K irchhoff’s Current Law(KCL) & Current di...Electrical circuit verification of K irchhoff’s Current Law(KCL) & Current di...
Electrical circuit verification of K irchhoff’s Current Law(KCL) & Current di...
 
Exceptions
ExceptionsExceptions
Exceptions
 
square matrix
square matrixsquare matrix
square matrix
 
Application's of Numerical Math in CSE
Application's of Numerical Math in CSEApplication's of Numerical Math in CSE
Application's of Numerical Math in CSE
 
Road accident and student's protest at Bangladesh
Road accident and student's protest  at Bangladesh Road accident and student's protest  at Bangladesh
Road accident and student's protest at Bangladesh
 

Recently uploaded

Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 

Recently uploaded (20)

Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 

Basic C Structure and related terms with example

  • 1. Basic C Structure and related terms with example
  • 3. What is c programming? C has now become a widely used professional language for various reasons: Easy to learn. Structured language. It produces efficient programs . It can handle low-level activities. It can be compiled on a variety of computer platforms.
  • 4. Importance of Programming & Problem Solving • Here are some of the things that learning coding can empower someone to do- • To Make someone’s Own Website. • Become a Career Coder. • Start a Business • Some of the kinds of businesses you can start include… selling software selling mobile apps e-commerce selling your coding time. To Understand How Computers Work and so more.
  • 6. HEADER FILE • A header file is a file with extension .h which contains C function declarations . • There are two types of header files : Files that the programmer writes and Files that comes with a compiler. • For Example: stdio.h header file contains standard Input and Output functions. string.h header file contains string handling functions.
  • 7. Main function • main() function is the entry point of any C program; • It is the point at which execution of program is started; • When a C program is executed, the execution control goes directly to the main() function. • Every C program have a main() function. • It’s a compulsory for c program.
  • 8. Simple example of a program
  • 10. Program Structure • A sample of c program- #include<stdio.h> int main() { -----Statements---- // comments after double slash }
  • 12. Comments in c • A comment is a programmer-readable explanation; • They are added with the purpose of making the source code easier for humans to understand, and are generally ignored by compilers and interpreters. • Example- • Single line comment- //(double slash); Multiline comment- /*--------- ------*/ • This can span over to multiple line;
  • 13. Keywords in C Language
  • 14. variables • Variables are data that will keep on changing. A variable is nothing but a name given to a storage area that our programs can manipulate. • Declaration <<Data type>> <<variable name>>; int a; • Definition <<varname>>=<<value>>; a=10; • Usage <<varname>> I a=a+1; //increments the value of a by 1
  • 17. Constants • Constants refer to fixed values that the program may not alter during its execution. These fixed values are also called literals. • Given below is the form to use #define preprocessor to define a • constant − • #define identifier value
  • 18.
  • 19. Input Output INPUT -scanf(“%d”,&a); -gets an integer value from the user and stores it under the name ‘a’ Output -printf (“%d”,a); -print the value present in variable a on the screen
  • 21.