SlideShare a Scribd company logo
1 of 20
C
Topic

o Language

program
o Compile & Run
program
o Structure of C
program
o
•
•

Language)

(Low-Level

(Machine
language)
(MiddleLevel Language)

(Assembly Language)
(High-Level
Language)
Pascal, Fortran, C,
JAVA, …
1.
(Machine Language)

•

2 (0/1)

o
o

Object Code
(Assembly Language)

•
2
o
o

(

)
6
•

Languages)
–

(High-Level
C, JAVA,

Interpreter

(Compiler)

• Compiler
(
Pascal, C, ...)
• Interpreter
Compile
•

•

Source code (file)
C
Machine code (Object file)

C
Compile & Run
C

•
main)
•

C

(
Edit
C
• Preprocessor Directive
(

• Main Function (
1

Void main()

2

{

3

statements;

5

•

)

Programming

#include<stdio.h>

2

void main()

3

{

4
5

End

}

1

n

/* main function */
/ Begin (
)

variable declaration;

4

)

printf("C Programmingn");
}

cursor

C

/* Preprocessor directive*/
C
•

4

C

1.
Statements)
2.
Statements)
3.
Statements)
4.
Statements)

•

(Input / Output
(Expression
(Conditioning

(Looping

int x, y
float
• printf (
stdio)

C
Memory

stdio
Preprocessor Directive
o
printf
main
•
printf(“control string”,
variable,…);
 control string
o
printf(“C
o variable
(
Programming”); )
%d
integer
decimal %f
Memory
o %format
%d, %f, %c, %s
real
o

variable

o

n (new line), …
floating point


Programming

C
Memory
variable
(X)

• scanf (
stdio.h)
•

…

Address
0
1
2 (&X)
3
4
…

scanf(“%format,…”,
&variable,…);
o %format
o &variable

%d, %f, %c,

%s (Address)
scanf(“%d”, &X);
variable
integer

%d

integer
decimal %f
real
floating point

X

&X


2

(X, Y)
(Sum)

Memory

start

X
Y

Input X,Y

#include<stdio.h>

SUM

void main()
{
int X, Y, SUM;

printf("Enter X:"); scanf("%d", &X);

SUM = X+Y

printf("Enter Y:"); scanf("%d", &Y);

Print SUM

SUM = X+Y;
printf("Sum = %dn", SUM);

end

}

printf
(Output)
o scanf
C
o

C

(Input)

50
100
150
% format
• %format
scanf, printf
(integer)
(real)

%format
int

%d

float

%f

#include<stdio.h>
void main()
{
int X, Y, sum;
printf("Enter X:"); scanf("%d",&X);

printf("Enter Y:"); scanf("%d",&Y);
sum = X+Y
printf("sum = %dn", sum);
}

Memory
X
Y
SUM
3

W

Area
L



(Area)
Width x Length (
#include<stdio.h>

x

Area =
)

start
Input W,L

void main()
Area = W*L

{
int W,L;
float Area;
printf("Enter width:");

scanf("%d", &W);
printf("Enter length:");
scanf("%d", &L);
Area = W*L;
printf("Area = %fn", Area);
}

Print Area
end

Enter width: 5
_
Enter length: 10
_
Area = 50.0
4

1

2

3

4

5

6

7

8

9

10

11

12

1



(
#include<stdio.h>

)

start
Input Feet
F

void main()
Inches = Feet*12

{
int F,Inches;

Print Inches

printf("Enter feet:");
scanf("%d", &W);

end

inches = F*12;
printf("=%d inchesn", Inches);
}

Memory

2
Enter feet: _
= 24 inches

Inches
getchar, gets
• scanf
“%format

o

•

 getchar()

ENTER

Character
 getch()

ENTER

Library “stdio”
Library “conio”
(Day),



(Year)
November, 2013
Month day, year (
1, 2013 )
#include<stdio.h>
void main()

1,

(Month),
Memory

November
Day
Year

Month

{

int Day, Year;

1

2013

N
o
v
e
m
b
e
r

char Month[20];//string
printf("Enter Day:");scanf("%d",&Day);
printf("Enter Month:");scanf("%s",&Month);
printf("Enter Year:");scanf("%d",&Year);

1
Enter Day: _

printf("Date is %s %d,%dn",Month, Day, Year);

Enter Month: November
_

fflush(stdin);getchar();

2013
Enter Year: _

}

Date is November 1, 2013

Keyboard

More Related Content

What's hot

What's hot (6)

Programming Protocol-Independent Packet Processors
Programming Protocol-Independent Packet ProcessorsProgramming Protocol-Independent Packet Processors
Programming Protocol-Independent Packet Processors
 
Golang
GolangGolang
Golang
 
Golang 101
Golang 101Golang 101
Golang 101
 
R Intro
R IntroR Intro
R Intro
 
2016 NCTU P4 Workshop
2016 NCTU P4 Workshop2016 NCTU P4 Workshop
2016 NCTU P4 Workshop
 
Coding with golang
Coding with golangCoding with golang
Coding with golang
 

Viewers also liked

腾讯大讲堂25 企业级搜索托管平台介绍
腾讯大讲堂25 企业级搜索托管平台介绍腾讯大讲堂25 企业级搜索托管平台介绍
腾讯大讲堂25 企业级搜索托管平台介绍George Ang
 
Hadoop开发者入门专刊
Hadoop开发者入门专刊Hadoop开发者入门专刊
Hadoop开发者入门专刊liangxiao0315
 
基于Eucalyptus的教育知识服务体系模型研究(1)
基于Eucalyptus的教育知识服务体系模型研究(1)基于Eucalyptus的教育知识服务体系模型研究(1)
基于Eucalyptus的教育知识服务体系模型研究(1)liangxiao0315
 
基于云计算平台的移动Iptv系统设计及负载均衡技术研究
基于云计算平台的移动Iptv系统设计及负载均衡技术研究基于云计算平台的移动Iptv系统设计及负载均衡技术研究
基于云计算平台的移动Iptv系统设计及负载均衡技术研究liangxiao0315
 
Zaridah lecture2
Zaridah lecture2Zaridah lecture2
Zaridah lecture2Aziz Sahat
 
Pharmalinks Global Regulatory Partners
Pharmalinks Global Regulatory PartnersPharmalinks Global Regulatory Partners
Pharmalinks Global Regulatory Partnerstemreez
 
构建私有云计算平台的Eucalyptus架构分析
构建私有云计算平台的Eucalyptus架构分析构建私有云计算平台的Eucalyptus架构分析
构建私有云计算平台的Eucalyptus架构分析liangxiao0315
 

Viewers also liked (9)

腾讯大讲堂25 企业级搜索托管平台介绍
腾讯大讲堂25 企业级搜索托管平台介绍腾讯大讲堂25 企业级搜索托管平台介绍
腾讯大讲堂25 企业级搜索托管平台介绍
 
Hadoop开发者入门专刊
Hadoop开发者入门专刊Hadoop开发者入门专刊
Hadoop开发者入门专刊
 
Ds program-print
Ds program-printDs program-print
Ds program-print
 
基于Eucalyptus的教育知识服务体系模型研究(1)
基于Eucalyptus的教育知识服务体系模型研究(1)基于Eucalyptus的教育知识服务体系模型研究(1)
基于Eucalyptus的教育知识服务体系模型研究(1)
 
基于云计算平台的移动Iptv系统设计及负载均衡技术研究
基于云计算平台的移动Iptv系统设计及负载均衡技术研究基于云计算平台的移动Iptv系统设计及负载均衡技术研究
基于云计算平台的移动Iptv系统设计及负载均衡技术研究
 
Zaridah lecture2
Zaridah lecture2Zaridah lecture2
Zaridah lecture2
 
Function creation and function call in c copy
Function creation and function call in c   copyFunction creation and function call in c   copy
Function creation and function call in c copy
 
Pharmalinks Global Regulatory Partners
Pharmalinks Global Regulatory PartnersPharmalinks Global Regulatory Partners
Pharmalinks Global Regulatory Partners
 
构建私有云计算平台的Eucalyptus架构分析
构建私有云计算平台的Eucalyptus架构分析构建私有云计算平台的Eucalyptus架构分析
构建私有云计算平台的Eucalyptus架构分析
 

Similar to 2

0100_Embeded_C_CompilationProcess.pdf
0100_Embeded_C_CompilationProcess.pdf0100_Embeded_C_CompilationProcess.pdf
0100_Embeded_C_CompilationProcess.pdfKhaledIbrahim10923
 
Computer Programming In C.pptx
Computer Programming In C.pptxComputer Programming In C.pptx
Computer Programming In C.pptxchouguleamruta24
 
Programing fundamentals with C++
Programing fundamentals with C++Programing fundamentals with C++
Programing fundamentals with C++farooq2016
 
cmp104 lec 8
cmp104 lec 8cmp104 lec 8
cmp104 lec 8kapil078
 
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 cHarish Kumawat
 
Sachin kumar ppt on programming in c
Sachin kumar ppt on programming in cSachin kumar ppt on programming in c
Sachin kumar ppt on programming in cSachin Kumar
 
Lecture 1 introduction to language processors
Lecture 1  introduction to language processorsLecture 1  introduction to language processors
Lecture 1 introduction to language processorsRebaz Najeeb
 
โปรแกรมคอมพิวเตอร์
โปรแกรมคอมพิวเตอร์โปรแกรมคอมพิวเตอร์
โปรแกรมคอมพิวเตอร์Raksita Youngdee
 
Embedded firmware
Embedded firmwareEmbedded firmware
Embedded firmwareJoel P
 
What is turbo c and how it works
What is turbo c and how it worksWhat is turbo c and how it works
What is turbo c and how it worksMark John Lado, MIT
 
Chapter 1 Introduction to C .pptx
Chapter 1 Introduction to C .pptxChapter 1 Introduction to C .pptx
Chapter 1 Introduction to C .pptxAbdalla536859
 
Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming languageVasavi College of Engg
 
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
 
Introduction to c language by nitesh
Introduction to c language by niteshIntroduction to c language by nitesh
Introduction to c language by niteshniteshcongreja321
 
Chapter 1: Introduction
Chapter 1: IntroductionChapter 1: Introduction
Chapter 1: IntroductionEric Chou
 

Similar to 2 (20)

0100_Embeded_C_CompilationProcess.pdf
0100_Embeded_C_CompilationProcess.pdf0100_Embeded_C_CompilationProcess.pdf
0100_Embeded_C_CompilationProcess.pdf
 
C Language
C LanguageC Language
C Language
 
Computer Programming In C.pptx
Computer Programming In C.pptxComputer Programming In C.pptx
Computer Programming In C.pptx
 
Programing fundamentals with C++
Programing fundamentals with C++Programing fundamentals with C++
Programing fundamentals with C++
 
cmp104 lec 8
cmp104 lec 8cmp104 lec 8
cmp104 lec 8
 
C for Engineers
C for EngineersC for Engineers
C for Engineers
 
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
 
Sachin kumar ppt on programming in c
Sachin kumar ppt on programming in cSachin kumar ppt on programming in c
Sachin kumar ppt on programming in c
 
Lecture 1 introduction to language processors
Lecture 1  introduction to language processorsLecture 1  introduction to language processors
Lecture 1 introduction to language processors
 
โปรแกรมคอมพิวเตอร์
โปรแกรมคอมพิวเตอร์โปรแกรมคอมพิวเตอร์
โปรแกรมคอมพิวเตอร์
 
Embedded firmware
Embedded firmwareEmbedded firmware
Embedded firmware
 
What is turbo c and how it works
What is turbo c and how it worksWhat is turbo c and how it works
What is turbo c and how it works
 
Chapter 1 Introduction to C .pptx
Chapter 1 Introduction to C .pptxChapter 1 Introduction to C .pptx
Chapter 1 Introduction to C .pptx
 
Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming language
 
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
 
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
 
Introduction to c language by nitesh
Introduction to c language by niteshIntroduction to c language by nitesh
Introduction to c language by nitesh
 
Chapter 1: Introduction
Chapter 1: IntroductionChapter 1: Introduction
Chapter 1: Introduction
 

Recently uploaded

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 

Recently uploaded (20)

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 

2