SlideShare a Scribd company logo
1 of 26
Welcome to our presentation
Group Members: ID:
1.152-15-5983 Arafat Rahman
2.152-15-6049 Mahdi Hasan
3.152-15-6051 Mst. Rubaya Rumi
4.152-15-6057 Asfakur Rahman
152-15-6060 Ahmed Muhtasim
Anjum
CHAPTER
STRUCTURE OF C
LANGUAGE
Basic Structure of C Program
• The C programming language is a
popular and widely used programming
language for creating computer
programs.
• Benefits you gain from learning C:
1) be able to read and write code for a large
number of platforms
2) The jump to the object oriented C++
language becomes much easier.
Basic Structure of C Program
• C is what is called a compiled language
• This means that once you write your C
program, you must run it through a C
compiler
• The C program is the human-readable
form, while the executable that comes
out of the compiler is the machine-
readable
• What this means is that to write and run a
C program, you must have access to a C
compiler
Basic Structure of C Program
Basic Structure of C Program
• A C program contains these following
basic structures:
1) Comments
2) The #include Directive (C-library)
3) The main() function
4) Variables and Data type
5) C statement
6) Function Body
Basic Structure of C Program
/*This is a basic structure C program*/
#include <stdio.h>
void main ()
{
int miles = 26;
int yards;
float kilometers;
kilometers = 1.609 *(miles+yards/1760.0);
printf(“n A marathon is %f kms”,kilometers);
}
1
2
3
4
5
Basic Structure of C Program
Basic Structure of C Program
1.Comments
• To document programs & improve
readability
• Optional & non-executable statement
• Symbols /* and */ or // indicate the
beginning and the end of the comment
block
Basic Structure of C Program
/*A comment may be coded like this*/
//A comment may be coded like this
Note:
1. There is no space between (*) and slash (/)
2. Every /* (begin) must be matched with */ (end)
Basic Structure of C Program
2.The #include Directive
• Lines beginning with a pound sign (#) are
directives for the preprocessor
• The preprocessor is a utility program that
performs various modifications to the source
program
• A header file contains the source code that
allows the execution of the program
• Standard input/output header file replaces the
directive in the source code
Basic Structure of C Program
• The stdio.h header file enables the program to
perform basic input and output operations
• Allows the program to accept input from the
keyboard and display output on the screen
Basic Structure of C Program
#include <stdio.h>
Header File
Note:
1. Lines that start with the # sign are preprocessor
directives
2. The angled-bracket pair <> indicates that the
specified library file is the standard library
directory
Basic Structure of C Program
3. The main() function
• The main function is the point by where all
C programs start their execution
• The instructions contained within this
function's definition will always be the first
ones to be executed in any C program
• The word main is followed in the code by a
pair of parentheses (())
• These parentheses may enclose a list of
parameters within them
Basic Structure of C Program
• Right after these parentheses we can find the
body of the main function enclosed in braces
{ - Left Braces
} – Right Braces
–What is contained within these braces is
what the function does when it is executed
Basic Structure of C Program
Format:
data type function_name (parameters)
{
variable;
C statement;
}
void main ()
{
Statement;
Statement;
…………..;
…………..;
}
Body
Basic Structure of C Program
4. Variables and Identifiers
• If your program requests a value from the
user, or if it calculates a value, you will
want to remember it somewhere so you
can use it later. The way your program
remembers things is by using variables.
For example;
int b;
• A variable has a name (in this case, b) and
a type (in this case, int, an integer).
variableIdentifier
Basic Structure of C Program
• Each variable needs an identifier that distinguishes
it from the others
• A valid identifier is a sequence of one or more
letters, digits or underline characters _
• Variable identifiers always have to begin with a
letter
• They can also begin with an underline character _
, but this is usually reserved for compiler specific
keywords or external identifiers
• Identifiers cannot match with any reserve keywords
Basic Structure of C Program
Very important:
The C language is a "case sensitive" language. That means that
an identifier written in capital letters is not equivalent to
another one with the same name but written in small letters.
Basic Structure of C Program
5. Data Types
• The basic fundamental data types in C
Basic Structure of C Program
6. Reserved Keywords
• All reserved words appear in
lowercase
• What is the difference between
reserved words and standard
identifiers?
• The standard reserved keywords are;
Basic Structure of C Program
Keywords
auto double int struct
break else long switch
case enum register typedef
char extern return union
const float short unsigned
continue for signed void
default goto sizeof volatile
do if static while
Basic Structure of C Program
7) Constants
Numeric Constant
• Two types of constants; numeric constant and
symbolic constant
• Numeric constant- actual value assigned to
numeric variable, include integer and floating-
point values
• Integer constant- consists of digits and a unary
sign (+ or -)
• Floating point constant- Is a real number, a
numeric value with a decimal point
Basic Structure of C Program
Symbolic Constant
• Purpose is to define symbolic constant
• Symbolic constants are coded in
uppercase letters and retains its value
during the program run
• Normally placed at the beginning of
the program
• e.g: #define VALUE 100
Basic Structure of C Program
Non-numeric constants
• Character and string
• Character constant-is a single character
assigned to a character variable
• String constant- is a group of characters
assigned to a string variable
• Character constant = ‘R’ ‘n’ ‘$’
• String constant = “October 5th”
Structure

More Related Content

What's hot

Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languagesVarun Garg
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++Vineeta Garg
 
FINAL PAPER FP301 OBJECT ORIENTED PROGRAMMING
FINAL PAPER FP301 OBJECT ORIENTED PROGRAMMINGFINAL PAPER FP301 OBJECT ORIENTED PROGRAMMING
FINAL PAPER FP301 OBJECT ORIENTED PROGRAMMINGAmira Dolce Farhana
 
Software Cost Estimation Techniques
Software Cost Estimation TechniquesSoftware Cost Estimation Techniques
Software Cost Estimation TechniquesSanthi thi
 
class and objects
class and objectsclass and objects
class and objectsPayel Guria
 
SWE-401 - 1. Introduction to Software Engineering
SWE-401 - 1. Introduction to Software EngineeringSWE-401 - 1. Introduction to Software Engineering
SWE-401 - 1. Introduction to Software Engineeringghayour abbas
 
Software design, software engineering
Software design, software engineeringSoftware design, software engineering
Software design, software engineeringRupesh Vaishnav
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++rprajat007
 
Software Engineering Layered Technology Software Process Framework
Software Engineering  Layered Technology Software Process FrameworkSoftware Engineering  Layered Technology Software Process Framework
Software Engineering Layered Technology Software Process FrameworkJAINAM KAPADIYA
 
Java and its features
Java and its featuresJava and its features
Java and its featuresPydi Nikhil
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programmingprogramming9
 
Design Concepts in Software Engineering-1.pptx
Design Concepts in Software Engineering-1.pptxDesign Concepts in Software Engineering-1.pptx
Design Concepts in Software Engineering-1.pptxKarthigaiSelviS3
 

What's hot (20)

Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languages
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++
 
FINAL PAPER FP301 OBJECT ORIENTED PROGRAMMING
FINAL PAPER FP301 OBJECT ORIENTED PROGRAMMINGFINAL PAPER FP301 OBJECT ORIENTED PROGRAMMING
FINAL PAPER FP301 OBJECT ORIENTED PROGRAMMING
 
Software Cost Estimation Techniques
Software Cost Estimation TechniquesSoftware Cost Estimation Techniques
Software Cost Estimation Techniques
 
class and objects
class and objectsclass and objects
class and objects
 
Cocomo model
Cocomo modelCocomo model
Cocomo model
 
SWE-401 - 1. Introduction to Software Engineering
SWE-401 - 1. Introduction to Software EngineeringSWE-401 - 1. Introduction to Software Engineering
SWE-401 - 1. Introduction to Software Engineering
 
Software design, software engineering
Software design, software engineeringSoftware design, software engineering
Software design, software engineering
 
Cocomo model
Cocomo modelCocomo model
Cocomo model
 
Applet programming
Applet programming Applet programming
Applet programming
 
Normal forms
Normal formsNormal forms
Normal forms
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++
 
Introduction to programming languages
Introduction to programming languagesIntroduction to programming languages
Introduction to programming languages
 
Software Engineering Layered Technology Software Process Framework
Software Engineering  Layered Technology Software Process FrameworkSoftware Engineering  Layered Technology Software Process Framework
Software Engineering Layered Technology Software Process Framework
 
Java and its features
Java and its featuresJava and its features
Java and its features
 
Break and continue
Break and continueBreak and continue
Break and continue
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
 
DBMS: Types of keys
DBMS:  Types of keysDBMS:  Types of keys
DBMS: Types of keys
 
Finite Automata
Finite AutomataFinite Automata
Finite Automata
 
Design Concepts in Software Engineering-1.pptx
Design Concepts in Software Engineering-1.pptxDesign Concepts in Software Engineering-1.pptx
Design Concepts in Software Engineering-1.pptx
 

Viewers also liked

Fundamental Programming Lect 1
Fundamental Programming Lect 1Fundamental Programming Lect 1
Fundamental Programming Lect 1Namrah Erum
 
BASIC Programming Language
BASIC Programming LanguageBASIC Programming Language
BASIC Programming LanguageJeff Valerio
 
Programming fundamentals lecture 1&2
Programming fundamentals lecture 1&2Programming fundamentals lecture 1&2
Programming fundamentals lecture 1&2Raja Hamid
 
C programming session 01
C programming session 01C programming session 01
C programming session 01Dushmanta Nath
 
C language (Collected By Dushmanta)
C language  (Collected By Dushmanta)C language  (Collected By Dushmanta)
C language (Collected By Dushmanta)Dushmanta Nath
 
20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental Principles20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental PrinciplesIntro C# Book
 

Viewers also liked (7)

Fundamental Programming Lect 1
Fundamental Programming Lect 1Fundamental Programming Lect 1
Fundamental Programming Lect 1
 
BASIC Programming Language
BASIC Programming LanguageBASIC Programming Language
BASIC Programming Language
 
Programming fundamentals lecture 1&2
Programming fundamentals lecture 1&2Programming fundamentals lecture 1&2
Programming fundamentals lecture 1&2
 
C programming session 01
C programming session 01C programming session 01
C programming session 01
 
C language (Collected By Dushmanta)
C language  (Collected By Dushmanta)C language  (Collected By Dushmanta)
C language (Collected By Dushmanta)
 
20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental Principles20. Object-Oriented Programming Fundamental Principles
20. Object-Oriented Programming Fundamental Principles
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 

Similar to Structure

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
 
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
 
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
 
Introduction of c programming unit-ii ppt
Introduction of  c programming unit-ii pptIntroduction of  c programming unit-ii ppt
Introduction of c programming unit-ii pptJStalinAsstProfessor
 
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
 
Basic C Structure and related terms with example
Basic C Structure and related terms with exampleBasic C Structure and related terms with example
Basic C Structure and related terms with examplesanjana mun
 
c-introduction.pptx
c-introduction.pptxc-introduction.pptx
c-introduction.pptxMangala R
 
Basics of C Prog Lang.pdf
Basics of C Prog Lang.pdfBasics of C Prog Lang.pdf
Basics of C Prog Lang.pdfKalighatOkira
 

Similar to Structure (20)

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
 
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
 
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
 
Unit ii
Unit   iiUnit   ii
Unit ii
 
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
 
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
 
Introduction of c programming unit-ii ppt
Introduction of  c programming unit-ii pptIntroduction of  c programming unit-ii ppt
Introduction of c programming unit-ii ppt
 
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_Programming_Notes_ICE
C_Programming_Notes_ICEC_Programming_Notes_ICE
C_Programming_Notes_ICE
 
Basic C Structure and related terms with example
Basic C Structure and related terms with exampleBasic C Structure and related terms with example
Basic C Structure and related terms with example
 
Unit-2.pptx
Unit-2.pptxUnit-2.pptx
Unit-2.pptx
 
c-introduction.pptx
c-introduction.pptxc-introduction.pptx
c-introduction.pptx
 
8844632.ppt
8844632.ppt8844632.ppt
8844632.ppt
 
Basics of C Prog Lang.pdf
Basics of C Prog Lang.pdfBasics of C Prog Lang.pdf
Basics of C Prog Lang.pdf
 

More from Daffodil International University (9)

Linear and Bianry search
Linear and Bianry searchLinear and Bianry search
Linear and Bianry search
 
big data
big databig data
big data
 
N type-sc
N type-scN type-sc
N type-sc
 
Complex number
Complex numberComplex number
Complex number
 
Ahsan Manzil presentation‬
Ahsan  Manzil presentation‬Ahsan  Manzil presentation‬
Ahsan Manzil presentation‬
 
Encoders
EncodersEncoders
Encoders
 
physics presentation
physics presentationphysics presentation
physics presentation
 
nuclear fusion
nuclear fusionnuclear fusion
nuclear fusion
 
2g 3g 4g
2g 3g 4g2g 3g 4g
2g 3g 4g
 

Recently uploaded

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
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
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 

Recently uploaded (20)

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
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
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 

Structure

  • 1. Welcome to our presentation Group Members: ID: 1.152-15-5983 Arafat Rahman 2.152-15-6049 Mahdi Hasan 3.152-15-6051 Mst. Rubaya Rumi 4.152-15-6057 Asfakur Rahman 152-15-6060 Ahmed Muhtasim Anjum
  • 3. Basic Structure of C Program • The C programming language is a popular and widely used programming language for creating computer programs. • Benefits you gain from learning C: 1) be able to read and write code for a large number of platforms 2) The jump to the object oriented C++ language becomes much easier.
  • 4. Basic Structure of C Program • C is what is called a compiled language • This means that once you write your C program, you must run it through a C compiler • The C program is the human-readable form, while the executable that comes out of the compiler is the machine- readable • What this means is that to write and run a C program, you must have access to a C compiler
  • 5. Basic Structure of C Program
  • 6. Basic Structure of C Program • A C program contains these following basic structures: 1) Comments 2) The #include Directive (C-library) 3) The main() function 4) Variables and Data type 5) C statement 6) Function Body
  • 7. Basic Structure of C Program /*This is a basic structure C program*/ #include <stdio.h> void main () { int miles = 26; int yards; float kilometers; kilometers = 1.609 *(miles+yards/1760.0); printf(“n A marathon is %f kms”,kilometers); } 1 2 3 4 5
  • 8. Basic Structure of C Program
  • 9. Basic Structure of C Program 1.Comments • To document programs & improve readability • Optional & non-executable statement • Symbols /* and */ or // indicate the beginning and the end of the comment block
  • 10. Basic Structure of C Program /*A comment may be coded like this*/ //A comment may be coded like this Note: 1. There is no space between (*) and slash (/) 2. Every /* (begin) must be matched with */ (end)
  • 11. Basic Structure of C Program 2.The #include Directive • Lines beginning with a pound sign (#) are directives for the preprocessor • The preprocessor is a utility program that performs various modifications to the source program • A header file contains the source code that allows the execution of the program • Standard input/output header file replaces the directive in the source code
  • 12. Basic Structure of C Program • The stdio.h header file enables the program to perform basic input and output operations • Allows the program to accept input from the keyboard and display output on the screen
  • 13. Basic Structure of C Program #include <stdio.h> Header File Note: 1. Lines that start with the # sign are preprocessor directives 2. The angled-bracket pair <> indicates that the specified library file is the standard library directory
  • 14. Basic Structure of C Program 3. The main() function • The main function is the point by where all C programs start their execution • The instructions contained within this function's definition will always be the first ones to be executed in any C program • The word main is followed in the code by a pair of parentheses (()) • These parentheses may enclose a list of parameters within them
  • 15. Basic Structure of C Program • Right after these parentheses we can find the body of the main function enclosed in braces { - Left Braces } – Right Braces –What is contained within these braces is what the function does when it is executed
  • 16. Basic Structure of C Program Format: data type function_name (parameters) { variable; C statement; } void main () { Statement; Statement; …………..; …………..; } Body
  • 17. Basic Structure of C Program 4. Variables and Identifiers • If your program requests a value from the user, or if it calculates a value, you will want to remember it somewhere so you can use it later. The way your program remembers things is by using variables. For example; int b; • A variable has a name (in this case, b) and a type (in this case, int, an integer). variableIdentifier
  • 18. Basic Structure of C Program • Each variable needs an identifier that distinguishes it from the others • A valid identifier is a sequence of one or more letters, digits or underline characters _ • Variable identifiers always have to begin with a letter • They can also begin with an underline character _ , but this is usually reserved for compiler specific keywords or external identifiers • Identifiers cannot match with any reserve keywords
  • 19. Basic Structure of C Program Very important: The C language is a "case sensitive" language. That means that an identifier written in capital letters is not equivalent to another one with the same name but written in small letters.
  • 20. Basic Structure of C Program 5. Data Types • The basic fundamental data types in C
  • 21. Basic Structure of C Program 6. Reserved Keywords • All reserved words appear in lowercase • What is the difference between reserved words and standard identifiers? • The standard reserved keywords are;
  • 22. Basic Structure of C Program Keywords auto double int struct break else long switch case enum register typedef char extern return union const float short unsigned continue for signed void default goto sizeof volatile do if static while
  • 23. Basic Structure of C Program 7) Constants Numeric Constant • Two types of constants; numeric constant and symbolic constant • Numeric constant- actual value assigned to numeric variable, include integer and floating- point values • Integer constant- consists of digits and a unary sign (+ or -) • Floating point constant- Is a real number, a numeric value with a decimal point
  • 24. Basic Structure of C Program Symbolic Constant • Purpose is to define symbolic constant • Symbolic constants are coded in uppercase letters and retains its value during the program run • Normally placed at the beginning of the program • e.g: #define VALUE 100
  • 25. Basic Structure of C Program Non-numeric constants • Character and string • Character constant-is a single character assigned to a character variable • String constant- is a group of characters assigned to a string variable • Character constant = ‘R’ ‘n’ ‘$’ • String constant = “October 5th”