SlideShare a Scribd company logo
10
Basic Structure of C
5. Main function section: every C program must have one main
function. This section contains two parts: declaration part and
executable part. These two parts must appear in between the
opening and closing curly braces. The declaration part
declares all the variables that are going to be used in the
executable part. The executable part contains the main
programming logical statements or algorithm statements.
The executable must contain at least one statement. All the
statements in the declaration and executable parts must end
with a semicolon (;). This section is the logical end of the
program.
6. Subprogram section: if necessary then user defined functions
are defined here or created here.(if user defined functions are
used)
10
Most read
15
How a C program is Executed ?
Creating Source
Code
Creating Source
Code
Compiling
Source Code
Compiling
Source Code
Linking Object
File
Linking Object
File
[ Source Code
File .c ]
[ Object File .obj ]
[ Executable File
.exe ]
[ Empty File ]
15
Most read
17
How a C program
is executed
?
How a C program
is executed
?
17
Most read
1
Let Us
2
First Step to the 21st
Century
Literacy : Programming
First Step to the 21st
Century
Literacy : Programming
Introduction to C
 The C programming language was designed or invented by
Dennis Ritchie at Bell Laboratories in the early 1970s
 Influenced by
 ALGOL 60 (1960),
 CPL (Cambridge, 1963),
 BCPL (Martin Richard, 1967),
 B (Ken Thompson, 1970)
 Traditional C:
 The C Programming Language, by Brian Kernighan and
Dennis Ritchie, 2nd
Edition, Prentice Hall
 Referred to as K&R
 Standardized in 1989 by ANSI (American National Standards
Institute) known as ANSI C
3
4
The Father of C Programming
and UNIX
The Father of C Programming
and UNIX
Introduction to C
 C is a Middle-level language: suitable language for systems
programming
 It is a procedural or sequential language
 C is also called ELL or English like language
 C is easy to learn or understand
 It is a case sensitive language
 C is a small language: relies on a “library” of standard functions
 C is highly portable: means that c programs written for one
computer can be run on other computer with no modification.
 C is a permissive language: it assumes that you know what
you’re doing, so it allows you a wider degree of latitude than
many languages. It doesn’t mandate the detailed error-checking
found in other language
5
Strength of C
1. Portability: means that c programs written for one computer
can be run on other computer with no modification.
2. Robustness: it is a robust language which is rich in built in
functions and operators.
3. Easy to understand: it is called ELL as almost all the structures
are very much similar to English language.
4. Efficiency: intended for applications where assembly language
had traditionally been used.
5. Power: large collection of data types and operators
6. Flexibility: not only for system but also for embedded system
commercial data processing
7. Programs written in C is fast and efficient
8. Standard library
9. Integration with UNIX 6
Weakness of C
1. error-prone
2. Difficult to modify
3. Difficult to debug
4. It is difficult to write large codes or solve complex
problems in C
7
Basic Structure of C Programs
1. Documentation Section
2. Link section
3. Definition Section
4. Global Declaration Section
5. Main Function( )
{
1. Declaration part
2. Executable part
}
6. Subprogram section
User defined functions are build here
8
Basic Structure of C
1. Documentation section: it consists of a set of comment lines
giving the name of the program, the author, the purpose of the
program and how the program works. The intention is to
provide with some documentation or information so that the
program can be used or analyzed later.
2. Link section: it provides instruction to the compiler to link
functions from the system library.
3. Definition section: definition of all the symbolic constants are
goes here. (if any symbolic constants are used in the program)
4. Global declaration: global variables are declared here. The user
defined functions also can be declared here. (if any global
variables are used in the program)
9
Basic Structure of C
5. Main function section: every C program must have one main
function. This section contains two parts: declaration part and
executable part. These two parts must appear in between the
opening and closing curly braces. The declaration part
declares all the variables that are going to be used in the
executable part. The executable part contains the main
programming logical statements or algorithm statements.
The executable must contain at least one statement. All the
statements in the declaration and executable parts must end
with a semicolon (;). This section is the logical end of the
program.
6. Subprogram section: if necessary then user defined functions
are defined here or created here.(if user defined functions are
used)
10
Need to understand
 Concept of definition and declaration
 Declaration: it tells or declares the identity or type of
something. Like Rahim is a boy. It means Rahim is here
declared as a boy.
 Definition: it tells or defines the specific type. Like in
definition section we will define or describe what are the
characteristics of a boy or how the boy works.
11
Need to understand
 ( ) – is called the parenthesis
 { } – is called the curly braces
 [ ] – is called the bracket
 Parenthesis is used to denote a function
 Curly braces is used to create a body
 Every statement in C ends with a semicolon
12
A Simple C Program
/* This is the sample program to print a
message hello world. This is done by
course teacher */
#include <stdio.h>
#include <conio.h>
main ( )
{
clrscr();
printf(“Hello Worldn”);
getch();
} 13
How a C program is Executed ?
 A C program is executed in three phases:
1. Creating Source Code file
[ Empty file(input) Source Code File(output) ]
2. Compiling
[ Source Code File(input) Object File(output) ]
3. Linking
[ Object File(input) Executable File(output) ]
14
How a C program is Executed ?
Creating Source
Code
Creating Source
Code
Compiling
Source Code
Compiling
Source Code
Linking Object
File
Linking Object
File
[ Source Code
File .c ]
[ Object File .obj ]
[ Executable File
.exe ]
[ Empty File ]
15
Step by step
procedure how a C
program is
executed
Step by step
procedure how a C
program is
executed
16
How a C program
is executed
?
How a C program
is executed
?
17
18
Md. Shakhawat Hossain
Student of Department of Computer Science &
Engineering
University of Rajshahi
E-mail: mshimul86@gmail.com

More Related Content

What's hot (20)

structured programming
structured programmingstructured programming
structured programming
Ahmad54321
 
FUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPTFUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPT
03062679929
 
Process management os concept
Process management os conceptProcess management os concept
Process management os concept
priyadeosarkar91
 
Introduction to Programming Languages
Introduction to Programming LanguagesIntroduction to Programming Languages
Introduction to Programming Languages
educationfront
 
1. over view and history of c
1. over view and history of c1. over view and history of c
1. over view and history of c
Harish Kumawat
 
Object oriented programming c++
Object oriented programming c++Object oriented programming c++
Object oriented programming c++
Ankur Pandey
 
Lecture 5 - Structured Programming Language
Lecture 5 - Structured Programming Language Lecture 5 - Structured Programming Language
Lecture 5 - Structured Programming Language
Md. Imran Hossain Showrov
 
Basics of c++
Basics of c++Basics of c++
Basics of c++
Huba Akhtar
 
Data Types and Variables In C Programming
Data Types and Variables In C ProgrammingData Types and Variables In C Programming
Data Types and Variables In C Programming
Kamal Acharya
 
08 subprograms
08 subprograms08 subprograms
08 subprograms
baran19901990
 
Introduction to c++ ppt 1
Introduction to c++ ppt 1Introduction to c++ ppt 1
Introduction to c++ ppt 1
Prof. Dr. K. Adisesha
 
Type casting in c programming
Type casting in c programmingType casting in c programming
Type casting in c programming
Rumman Ansari
 
History of c
History of cHistory of c
History of c
Shipat Bhuiya
 
Programming languages
Programming languagesProgramming languages
Programming languages
Akash Varaiya
 
What is keyword in c programming
What is keyword in c programmingWhat is keyword in c programming
What is keyword in c programming
Rumman Ansari
 
Unit 3. Input and Output
Unit 3. Input and OutputUnit 3. Input and Output
Unit 3. Input and Output
Ashim Lamichhane
 
Presentation on Programming Languages.
Presentation on Programming Languages.Presentation on Programming Languages.
Presentation on Programming Languages.
Mohammad Shakirul islam
 
While loop
While loopWhile loop
While loop
Feras_83
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
Neeru Mittal
 
System software
System softwareSystem software
System software
Harsha Sachdeva
 
structured programming
structured programmingstructured programming
structured programming
Ahmad54321
 
FUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPTFUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPT
03062679929
 
Process management os concept
Process management os conceptProcess management os concept
Process management os concept
priyadeosarkar91
 
Introduction to Programming Languages
Introduction to Programming LanguagesIntroduction to Programming Languages
Introduction to Programming Languages
educationfront
 
1. over view and history of c
1. over view and history of c1. over view and history of c
1. over view and history of c
Harish Kumawat
 
Object oriented programming c++
Object oriented programming c++Object oriented programming c++
Object oriented programming c++
Ankur Pandey
 
Lecture 5 - Structured Programming Language
Lecture 5 - Structured Programming Language Lecture 5 - Structured Programming Language
Lecture 5 - Structured Programming Language
Md. Imran Hossain Showrov
 
Data Types and Variables In C Programming
Data Types and Variables In C ProgrammingData Types and Variables In C Programming
Data Types and Variables In C Programming
Kamal Acharya
 
Type casting in c programming
Type casting in c programmingType casting in c programming
Type casting in c programming
Rumman Ansari
 
Programming languages
Programming languagesProgramming languages
Programming languages
Akash Varaiya
 
What is keyword in c programming
What is keyword in c programmingWhat is keyword in c programming
What is keyword in c programming
Rumman Ansari
 
While loop
While loopWhile loop
While loop
Feras_83
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
Neeru Mittal
 

Viewers also liked (20)

Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMING
Abhishek Dwivedi
 
C ppt
C pptC ppt
C ppt
jasmeen kr
 
Basics of C programming
Basics of C programmingBasics of C programming
Basics of C programming
avikdhupar
 
Introduction of c programming
Introduction of c programmingIntroduction of c programming
Introduction of c programming
Tarun Sharma
 
Overview of c language
Overview of c languageOverview of c language
Overview of c language
shalini392
 
C Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpointC Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpoint
JavaTpoint.Com
 
C tutorial
C tutorialC tutorial
C tutorial
Chukka Nikhil Chakravarthy
 
Concept of c
Concept of cConcept of c
Concept of c
Rohan Gajre
 
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 programming
Manoj Tyagi
 
Programming in C Basics
Programming in C BasicsProgramming in C Basics
Programming in C Basics
Bharat Kalia
 
Embedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterEmbedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals master
Hossam Hassan
 
introduction to c programming language
introduction to c programming languageintroduction to c programming language
introduction to c programming language
sanjay joshi
 
C language ppt
C language pptC language ppt
C language ppt
Ğäùråv Júñêjå
 
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
Malikireddy Bramhananda Reddy
 
Unit ii
Unit   iiUnit   ii
Unit ii
sathisaran
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
Alpana Gupta
 
Introduction to C Language (By: Shujaat Abbas)
Introduction to C Language (By: Shujaat Abbas)Introduction to C Language (By: Shujaat Abbas)
Introduction to C Language (By: Shujaat Abbas)
Shujaat Abbas
 
Medicaid organization profile
Medicaid organization profileMedicaid organization profile
Medicaid organization profile
Anurag Byala
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMING
Abhishek Dwivedi
 
Basics of C programming
Basics of C programmingBasics of C programming
Basics of C programming
avikdhupar
 
Introduction of c programming
Introduction of c programmingIntroduction of c programming
Introduction of c programming
Tarun Sharma
 
Overview of c language
Overview of c languageOverview of c language
Overview of c language
shalini392
 
C Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpointC Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpoint
JavaTpoint.Com
 
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 programming
Manoj Tyagi
 
Programming in C Basics
Programming in C BasicsProgramming in C Basics
Programming in C Basics
Bharat Kalia
 
Embedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterEmbedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals master
Hossam Hassan
 
introduction to c programming language
introduction to c programming languageintroduction to c programming language
introduction to c programming language
sanjay joshi
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
Alpana Gupta
 
Introduction to C Language (By: Shujaat Abbas)
Introduction to C Language (By: Shujaat Abbas)Introduction to C Language (By: Shujaat Abbas)
Introduction to C Language (By: Shujaat Abbas)
Shujaat Abbas
 
Medicaid organization profile
Medicaid organization profileMedicaid organization profile
Medicaid organization profile
Anurag Byala
 
Ad

Similar to Introduction to programming with c, (20)

Introduction to c language
Introduction to c language Introduction to c language
Introduction to c language
BAKRANIYA KALPESH
 
Unit-1_c.pptx you from the heart of the day revision
Unit-1_c.pptx you from the heart of the day revisionUnit-1_c.pptx you from the heart of the day revision
Unit-1_c.pptx you from the heart of the day revision
MohammedAnas871930
 
chapter 1.pptx
chapter 1.pptxchapter 1.pptx
chapter 1.pptx
SeethaDinesh
 
Btech i pic u-1 introduction to c language
Btech i pic u-1 introduction to c languageBtech i pic u-1 introduction to c language
Btech i pic u-1 introduction to c language
Rai University
 
Best Computer Institute in Pitampura, Delhi, Learn from Industry Experts.
Best Computer Institute in Pitampura, Delhi, Learn from Industry Experts.Best Computer Institute in Pitampura, Delhi, Learn from Industry Experts.
Best Computer Institute in Pitampura, Delhi, Learn from Industry Experts.
Veridical Technologies
 
Mca i pic u-1 introduction to c language
Mca i pic u-1 introduction to c languageMca i pic u-1 introduction to c language
Mca i pic u-1 introduction to c language
Rai University
 
introduction to c language
 introduction to c language introduction to c language
introduction to c language
Rai University
 
C session 1.pptx
C session 1.pptxC session 1.pptx
C session 1.pptx
NIRMALRAJSCSE20
 
C.pdf
C.pdfC.pdf
C.pdf
5reality786
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
Anandhasilambarasan D
 
C Programming UNIT 1.pptx
C Programming  UNIT 1.pptxC Programming  UNIT 1.pptx
C Programming UNIT 1.pptx
Mugilvannan11
 
Bsc cs i pic u-1 introduction to c language
Bsc cs i pic u-1 introduction to c languageBsc cs i pic u-1 introduction to c language
Bsc cs i pic u-1 introduction to c language
Rai University
 
Diploma ii cfpc u-1 introduction to c language
Diploma ii  cfpc u-1 introduction to c languageDiploma ii  cfpc u-1 introduction to c language
Diploma ii cfpc u-1 introduction to c language
Rai University
 
Computer Programming In C.pptx
Computer Programming In C.pptxComputer Programming In C.pptx
Computer Programming In C.pptx
chouguleamruta24
 
UNIT - 1jhjhjbkjhkjhkjhkjhkjhhkkhhh.pptx
UNIT - 1jhjhjbkjhkjhkjhkjhkjhhkkhhh.pptxUNIT - 1jhjhjbkjhkjhkjhkjhkjhhkkhhh.pptx
UNIT - 1jhjhjbkjhkjhkjhkjhkjhhkkhhh.pptx
RoselinLourd
 
Basics of C Prog Lang.pdf
Basics of C Prog Lang.pdfBasics of C Prog Lang.pdf
Basics of C Prog Lang.pdf
KalighatOkira
 
88 c programs 15184
88 c programs 1518488 c programs 15184
88 c programs 15184
Sumit Saini
 
88 c-programs
88 c-programs88 c-programs
88 c-programs
Minh Thắng Trần
 
Programming In C- (1)jhgjhgjhgjhghj.docx
Programming In C- (1)jhgjhgjhgjhghj.docxProgramming In C- (1)jhgjhgjhgjhghj.docx
Programming In C- (1)jhgjhgjhgjhghj.docx
Dpak Chavan
 
C class basic programming 1 PPT mayanka (1).pdf
C class basic programming 1 PPT mayanka (1).pdfC class basic programming 1 PPT mayanka (1).pdf
C class basic programming 1 PPT mayanka (1).pdf
mayankamandal
 
Unit-1_c.pptx you from the heart of the day revision
Unit-1_c.pptx you from the heart of the day revisionUnit-1_c.pptx you from the heart of the day revision
Unit-1_c.pptx you from the heart of the day revision
MohammedAnas871930
 
Btech i pic u-1 introduction to c language
Btech i pic u-1 introduction to c languageBtech i pic u-1 introduction to c language
Btech i pic u-1 introduction to c language
Rai University
 
Best Computer Institute in Pitampura, Delhi, Learn from Industry Experts.
Best Computer Institute in Pitampura, Delhi, Learn from Industry Experts.Best Computer Institute in Pitampura, Delhi, Learn from Industry Experts.
Best Computer Institute in Pitampura, Delhi, Learn from Industry Experts.
Veridical Technologies
 
Mca i pic u-1 introduction to c language
Mca i pic u-1 introduction to c languageMca i pic u-1 introduction to c language
Mca i pic u-1 introduction to c language
Rai University
 
introduction to c language
 introduction to c language introduction to c language
introduction to c language
Rai University
 
C Programming UNIT 1.pptx
C Programming  UNIT 1.pptxC Programming  UNIT 1.pptx
C Programming UNIT 1.pptx
Mugilvannan11
 
Bsc cs i pic u-1 introduction to c language
Bsc cs i pic u-1 introduction to c languageBsc cs i pic u-1 introduction to c language
Bsc cs i pic u-1 introduction to c language
Rai University
 
Diploma ii cfpc u-1 introduction to c language
Diploma ii  cfpc u-1 introduction to c languageDiploma ii  cfpc u-1 introduction to c language
Diploma ii cfpc u-1 introduction to c language
Rai University
 
Computer Programming In C.pptx
Computer Programming In C.pptxComputer Programming In C.pptx
Computer Programming In C.pptx
chouguleamruta24
 
UNIT - 1jhjhjbkjhkjhkjhkjhkjhhkkhhh.pptx
UNIT - 1jhjhjbkjhkjhkjhkjhkjhhkkhhh.pptxUNIT - 1jhjhjbkjhkjhkjhkjhkjhhkkhhh.pptx
UNIT - 1jhjhjbkjhkjhkjhkjhkjhhkkhhh.pptx
RoselinLourd
 
Basics of C Prog Lang.pdf
Basics of C Prog Lang.pdfBasics of C Prog Lang.pdf
Basics of C Prog Lang.pdf
KalighatOkira
 
88 c programs 15184
88 c programs 1518488 c programs 15184
88 c programs 15184
Sumit Saini
 
Programming In C- (1)jhgjhgjhgjhghj.docx
Programming In C- (1)jhgjhgjhgjhghj.docxProgramming In C- (1)jhgjhgjhgjhghj.docx
Programming In C- (1)jhgjhgjhgjhghj.docx
Dpak Chavan
 
C class basic programming 1 PPT mayanka (1).pdf
C class basic programming 1 PPT mayanka (1).pdfC class basic programming 1 PPT mayanka (1).pdf
C class basic programming 1 PPT mayanka (1).pdf
mayankamandal
 
Ad

More from Hossain Md Shakhawat (20)

Recipe for the effective presentaion
Recipe for the effective presentaionRecipe for the effective presentaion
Recipe for the effective presentaion
Hossain Md Shakhawat
 
The Road to Higher study in Japan
The Road to Higher study in JapanThe Road to Higher study in Japan
The Road to Higher study in Japan
Hossain Md Shakhawat
 
Application of dfs
Application of dfsApplication of dfs
Application of dfs
Hossain Md Shakhawat
 
Breadth first search and depth first search
Breadth first search and  depth first searchBreadth first search and  depth first search
Breadth first search and depth first search
Hossain Md Shakhawat
 
Islamic jurisprudence
Islamic jurisprudenceIslamic jurisprudence
Islamic jurisprudence
Hossain Md Shakhawat
 
Introduction to Medical Imaging
Introduction to Medical ImagingIntroduction to Medical Imaging
Introduction to Medical Imaging
Hossain Md Shakhawat
 
Jpeg compression
Jpeg compressionJpeg compression
Jpeg compression
Hossain Md Shakhawat
 
Surah Fatiha
Surah FatihaSurah Fatiha
Surah Fatiha
Hossain Md Shakhawat
 
Hashing
HashingHashing
Hashing
Hossain Md Shakhawat
 
Decision making and looping
Decision making and loopingDecision making and looping
Decision making and looping
Hossain Md Shakhawat
 
Decision making and branching
Decision making and branchingDecision making and branching
Decision making and branching
Hossain Md Shakhawat
 
Digital signature
Digital signatureDigital signature
Digital signature
Hossain Md Shakhawat
 
Caesar cipher
Caesar cipherCaesar cipher
Caesar cipher
Hossain Md Shakhawat
 
Rsa rivest shamir adleman
Rsa rivest shamir adlemanRsa rivest shamir adleman
Rsa rivest shamir adleman
Hossain Md Shakhawat
 
Fundamentals of cryptography
Fundamentals of cryptographyFundamentals of cryptography
Fundamentals of cryptography
Hossain Md Shakhawat
 
Introduction to digital image processing
Introduction to digital image processingIntroduction to digital image processing
Introduction to digital image processing
Hossain Md Shakhawat
 
History of computing
History of computingHistory of computing
History of computing
Hossain Md Shakhawat
 
Introduction to Printers
Introduction to PrintersIntroduction to Printers
Introduction to Printers
Hossain Md Shakhawat
 
Input devices_(Mouse and Keyboard)
Input devices_(Mouse and Keyboard)Input devices_(Mouse and Keyboard)
Input devices_(Mouse and Keyboard)
Hossain Md Shakhawat
 
Binary search tree(bst)
Binary search tree(bst)Binary search tree(bst)
Binary search tree(bst)
Hossain Md Shakhawat
 

Recently uploaded (20)

How to Manage Orders in Odoo 18 Lunch - Odoo Slides
How to Manage Orders in Odoo 18 Lunch - Odoo SlidesHow to Manage Orders in Odoo 18 Lunch - Odoo Slides
How to Manage Orders in Odoo 18 Lunch - Odoo Slides
Celine George
 
Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..
faizanaltaf231
 
LDMMIA Bonus GUEST GRAD Student Check-in
LDMMIA Bonus GUEST GRAD Student Check-inLDMMIA Bonus GUEST GRAD Student Check-in
LDMMIA Bonus GUEST GRAD Student Check-in
LDM & Mia eStudios
 
STUDENT LOAN TRUST FUND DEFAULTERS GHANA
STUDENT LOAN TRUST FUND DEFAULTERS GHANASTUDENT LOAN TRUST FUND DEFAULTERS GHANA
STUDENT LOAN TRUST FUND DEFAULTERS GHANA
Kweku Zurek
 
0b - THE ROMANTIC ERA: FEELINGS AND IDENTITY.pptx
0b - THE ROMANTIC ERA: FEELINGS AND IDENTITY.pptx0b - THE ROMANTIC ERA: FEELINGS AND IDENTITY.pptx
0b - THE ROMANTIC ERA: FEELINGS AND IDENTITY.pptx
Julián Jesús Pérez Fernández
 
Odoo 18 Point of Sale PWA - Odoo Slides
Odoo 18 Point of Sale PWA  - Odoo  SlidesOdoo 18 Point of Sale PWA  - Odoo  Slides
Odoo 18 Point of Sale PWA - Odoo Slides
Celine George
 
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based EducatorDiana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda
 
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdfTechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Stewart Butler - OECD - How to design and deliver higher technical education ...
Stewart Butler - OECD - How to design and deliver higher technical education ...Stewart Butler - OECD - How to design and deliver higher technical education ...
Stewart Butler - OECD - How to design and deliver higher technical education ...
EduSkills OECD
 
How to Configure Add to Cart in Odoo 18 Website
How to Configure Add to Cart in Odoo 18 WebsiteHow to Configure Add to Cart in Odoo 18 Website
How to Configure Add to Cart in Odoo 18 Website
Celine George
 
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGYHUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
DHARMENDRA SAHU
 
Exploring Identity Through Colombian Companies
Exploring Identity Through Colombian CompaniesExploring Identity Through Colombian Companies
Exploring Identity Through Colombian Companies
OlgaLeonorTorresSnch
 
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
Arshad Shaikh
 
QUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptx
QUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptxQUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptx
QUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptx
Sourav Kr Podder
 
Pragya Champion's Chalice 2025 Set , General Quiz
Pragya Champion's Chalice 2025 Set , General QuizPragya Champion's Chalice 2025 Set , General Quiz
Pragya Champion's Chalice 2025 Set , General Quiz
Pragya - UEM Kolkata Quiz Club
 
PHYSIOLOGY & SPORTS INJURY by Diwakar Sir
PHYSIOLOGY & SPORTS INJURY by Diwakar SirPHYSIOLOGY & SPORTS INJURY by Diwakar Sir
PHYSIOLOGY & SPORTS INJURY by Diwakar Sir
Diwakar Kashyap
 
Types of Actions in Odoo 18 - Odoo Slides
Types of Actions in Odoo 18 - Odoo SlidesTypes of Actions in Odoo 18 - Odoo Slides
Types of Actions in Odoo 18 - Odoo Slides
Celine George
 
LET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSE
LET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSELET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSE
LET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSE
OlgaLeonorTorresSnch
 
Critical Thinking and Bias with Jibi Moses
Critical Thinking and Bias with Jibi MosesCritical Thinking and Bias with Jibi Moses
Critical Thinking and Bias with Jibi Moses
Excellence Foundation for South Sudan
 
How to Manage Orders in Odoo 18 Lunch - Odoo Slides
How to Manage Orders in Odoo 18 Lunch - Odoo SlidesHow to Manage Orders in Odoo 18 Lunch - Odoo Slides
How to Manage Orders in Odoo 18 Lunch - Odoo Slides
Celine George
 
Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..
faizanaltaf231
 
LDMMIA Bonus GUEST GRAD Student Check-in
LDMMIA Bonus GUEST GRAD Student Check-inLDMMIA Bonus GUEST GRAD Student Check-in
LDMMIA Bonus GUEST GRAD Student Check-in
LDM & Mia eStudios
 
STUDENT LOAN TRUST FUND DEFAULTERS GHANA
STUDENT LOAN TRUST FUND DEFAULTERS GHANASTUDENT LOAN TRUST FUND DEFAULTERS GHANA
STUDENT LOAN TRUST FUND DEFAULTERS GHANA
Kweku Zurek
 
Odoo 18 Point of Sale PWA - Odoo Slides
Odoo 18 Point of Sale PWA  - Odoo  SlidesOdoo 18 Point of Sale PWA  - Odoo  Slides
Odoo 18 Point of Sale PWA - Odoo Slides
Celine George
 
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based EducatorDiana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda
 
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdfTechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup Microsoft Copilot Nonprofit Use Cases and Live Demo - 2025.05.28.pdf
TechSoup
 
Stewart Butler - OECD - How to design and deliver higher technical education ...
Stewart Butler - OECD - How to design and deliver higher technical education ...Stewart Butler - OECD - How to design and deliver higher technical education ...
Stewart Butler - OECD - How to design and deliver higher technical education ...
EduSkills OECD
 
How to Configure Add to Cart in Odoo 18 Website
How to Configure Add to Cart in Odoo 18 WebsiteHow to Configure Add to Cart in Odoo 18 Website
How to Configure Add to Cart in Odoo 18 Website
Celine George
 
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGYHUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
HUMAN SKELETAL SYSTEM ANATAMY AND PHYSIOLOGY
DHARMENDRA SAHU
 
Exploring Identity Through Colombian Companies
Exploring Identity Through Colombian CompaniesExploring Identity Through Colombian Companies
Exploring Identity Through Colombian Companies
OlgaLeonorTorresSnch
 
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
Arshad Shaikh
 
QUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptx
QUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptxQUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptx
QUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptx
Sourav Kr Podder
 
PHYSIOLOGY & SPORTS INJURY by Diwakar Sir
PHYSIOLOGY & SPORTS INJURY by Diwakar SirPHYSIOLOGY & SPORTS INJURY by Diwakar Sir
PHYSIOLOGY & SPORTS INJURY by Diwakar Sir
Diwakar Kashyap
 
Types of Actions in Odoo 18 - Odoo Slides
Types of Actions in Odoo 18 - Odoo SlidesTypes of Actions in Odoo 18 - Odoo Slides
Types of Actions in Odoo 18 - Odoo Slides
Celine George
 
LET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSE
LET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSELET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSE
LET´S PRACTICE GRAMMAR USING SIMPLE PAST TENSE
OlgaLeonorTorresSnch
 

Introduction to programming with c,

  • 2. 2 First Step to the 21st Century Literacy : Programming First Step to the 21st Century Literacy : Programming
  • 3. Introduction to C  The C programming language was designed or invented by Dennis Ritchie at Bell Laboratories in the early 1970s  Influenced by  ALGOL 60 (1960),  CPL (Cambridge, 1963),  BCPL (Martin Richard, 1967),  B (Ken Thompson, 1970)  Traditional C:  The C Programming Language, by Brian Kernighan and Dennis Ritchie, 2nd Edition, Prentice Hall  Referred to as K&R  Standardized in 1989 by ANSI (American National Standards Institute) known as ANSI C 3
  • 4. 4 The Father of C Programming and UNIX The Father of C Programming and UNIX
  • 5. Introduction to C  C is a Middle-level language: suitable language for systems programming  It is a procedural or sequential language  C is also called ELL or English like language  C is easy to learn or understand  It is a case sensitive language  C is a small language: relies on a “library” of standard functions  C is highly portable: means that c programs written for one computer can be run on other computer with no modification.  C is a permissive language: it assumes that you know what you’re doing, so it allows you a wider degree of latitude than many languages. It doesn’t mandate the detailed error-checking found in other language 5
  • 6. Strength of C 1. Portability: means that c programs written for one computer can be run on other computer with no modification. 2. Robustness: it is a robust language which is rich in built in functions and operators. 3. Easy to understand: it is called ELL as almost all the structures are very much similar to English language. 4. Efficiency: intended for applications where assembly language had traditionally been used. 5. Power: large collection of data types and operators 6. Flexibility: not only for system but also for embedded system commercial data processing 7. Programs written in C is fast and efficient 8. Standard library 9. Integration with UNIX 6
  • 7. Weakness of C 1. error-prone 2. Difficult to modify 3. Difficult to debug 4. It is difficult to write large codes or solve complex problems in C 7
  • 8. Basic Structure of C Programs 1. Documentation Section 2. Link section 3. Definition Section 4. Global Declaration Section 5. Main Function( ) { 1. Declaration part 2. Executable part } 6. Subprogram section User defined functions are build here 8
  • 9. Basic Structure of C 1. Documentation section: it consists of a set of comment lines giving the name of the program, the author, the purpose of the program and how the program works. The intention is to provide with some documentation or information so that the program can be used or analyzed later. 2. Link section: it provides instruction to the compiler to link functions from the system library. 3. Definition section: definition of all the symbolic constants are goes here. (if any symbolic constants are used in the program) 4. Global declaration: global variables are declared here. The user defined functions also can be declared here. (if any global variables are used in the program) 9
  • 10. Basic Structure of C 5. Main function section: every C program must have one main function. This section contains two parts: declaration part and executable part. These two parts must appear in between the opening and closing curly braces. The declaration part declares all the variables that are going to be used in the executable part. The executable part contains the main programming logical statements or algorithm statements. The executable must contain at least one statement. All the statements in the declaration and executable parts must end with a semicolon (;). This section is the logical end of the program. 6. Subprogram section: if necessary then user defined functions are defined here or created here.(if user defined functions are used) 10
  • 11. Need to understand  Concept of definition and declaration  Declaration: it tells or declares the identity or type of something. Like Rahim is a boy. It means Rahim is here declared as a boy.  Definition: it tells or defines the specific type. Like in definition section we will define or describe what are the characteristics of a boy or how the boy works. 11
  • 12. Need to understand  ( ) – is called the parenthesis  { } – is called the curly braces  [ ] – is called the bracket  Parenthesis is used to denote a function  Curly braces is used to create a body  Every statement in C ends with a semicolon 12
  • 13. A Simple C Program /* This is the sample program to print a message hello world. This is done by course teacher */ #include <stdio.h> #include <conio.h> main ( ) { clrscr(); printf(“Hello Worldn”); getch(); } 13
  • 14. How a C program is Executed ?  A C program is executed in three phases: 1. Creating Source Code file [ Empty file(input) Source Code File(output) ] 2. Compiling [ Source Code File(input) Object File(output) ] 3. Linking [ Object File(input) Executable File(output) ] 14
  • 15. How a C program is Executed ? Creating Source Code Creating Source Code Compiling Source Code Compiling Source Code Linking Object File Linking Object File [ Source Code File .c ] [ Object File .obj ] [ Executable File .exe ] [ Empty File ] 15
  • 16. Step by step procedure how a C program is executed Step by step procedure how a C program is executed 16
  • 17. How a C program is executed ? How a C program is executed ? 17
  • 18. 18 Md. Shakhawat Hossain Student of Department of Computer Science & Engineering University of Rajshahi E-mail: [email protected]