SlideShare a Scribd company logo
How C
Program
Execute
To type your C program you need a program called Editor
Example:
Notepad
Notepad++
or any IDE
Once the program has been typed it needs to be converted to machine language (0s
and 1s) before the machine can execute it .
To carry out this conversion we need another program called Compiler. Compiler
vendors provide an Integrated Development Environment (IDE) which consists of an
Editor as well as the Compiler.
Compiler Example:
gcc
IDE Example:
Turbo C,
Visual C++ ,
Borland C++
Write down program in IDE
and save it with extension(.c)
example: program_name.c
1. #include<stdio.h>
2. int main()
3. {
4. int a, b, c;
5.
6. printf("Enter two numbers to addn");
7. scanf("%d%d",&a,&b);
8.
9. c = a + b;
10.
11. printf("Sum of entered numbers = %dn",c);
12.
13. return 0;
14. }
Compile The Program
Compile Completed
no error is detected
and object file also created
Example: program_name.obj
Execution
with
Explanation
1. #include<stdio.h>
2. int main()
3. {
4. int a, b, c;
5.
6. printf("Enter two numbers to addn");
7. scanf("%d%d",&a,&b);
8.
9. c = a + b;
10.
11. printf("Sum of entered numbers = %dn",c);
12.
13. return 0;
14. }
Main Memory
Memory Address
102543
142586
135545
135487
It is a preprocessor command
1. #include<stdio.h>
2. int main()
3. {
4. int a, b, c;
5.
6. printf("Enter two numbers to addn");
7. scanf("%d%d",&a,&b);
8.
9. c = a + b;
10.
11. printf("Sum of entered numbers = %dn",c);
12.
13. return 0;
14. }
Main Memory
Memory Address
102543
142586
135545
135487
It is the main function where the program execution begins
1. #include<stdio.h>
2. int main()
3. {
4. int a, b, c;
5.
6. printf("Enter two numbers to addn");
7. scanf("%d%d",&a,&b);
8.
9. c = a + b;
10.
11. printf("Sum of entered numbers = %dn",c);
12.
13. return 0;
14. }
Main Memory
Memory Address
102543
142586
135545
135487
First open brace of main function
1. #include<stdio.h>
2. int main()
3. {
4. int a, b, c;
5.
6. printf("Enter two numbers to addn");
7. scanf("%d%d",&a,&b);
8.
9. c = a + b;
10.
11. printf("Sum of entered numbers = %dn",c);
12.
13. return 0;
14. }
Main Memory
Memory Address
102543
142586
135545
135487
Memory allocation for three variable a,b,c
1. #include<stdio.h>
2. int main()
3. {
4. int a, b, c;
5.
6. printf("Enter two numbers to addn");
7. scanf("%d%d",&a,&b);
8.
9. c = a + b;
10.
11. printf("Sum of entered numbers = %dn",c);
12.
13. return 0;
14. }
Memory
int a
int c
Main Memory
int b
Address
102543
142586
135545
135487
printf(...) is a function which is use to show any message to
the user
1. #include<stdio.h>
2. int main()
3. {
4. int a, b, c;
5.
6. printf("Enter two numbers to addn");
7. scanf("%d%d",&a,&b);
8.
9. c = a + b;
10.
11. printf("Sum of entered numbers = %dn",c);
12.
13. return 0;
14. }
Memory
int a
int c
Main Memory
int b
Address
102543
142586
135545
135487
User’s console or cmd
message to the user
Enter two numbers to add
scanf(...) is another function available in C which is use to take
value form user by keyboard
1. #include<stdio.h>
2. int main()
3. {
4. int a, b, c;
5.
6. printf("Enter two numbers to addn");
7. scanf("%d%d",&a,&b);
8.
9. c = a + b;
10.
11. printf("Sum of entered numbers = %dn",c);
12.
13. return 0;
14. }
Memory
int a
int c
Main Memory
int b
Address
102543
142586
135545
135487
User’s console or cmd
give the value of a=6 and b=5
Enter two numbers to add
6
5
Insertion of a and b in memory
1. #include<stdio.h>
2. int main()
3. {
4. int a, b, c;
5.
6. printf("Enter two numbers to addn");
7. scanf("%d%d",&a,&b);
8.
9. c = a + b;
10.
11. printf("Sum of entered numbers = %dn",c);
12.
13. return 0;
14. }
Memory
int a
int c
Main Memory
int b
Address
102543
142586
135545
135487
Insertion of a and b in memory
1. #include<stdio.h>
2. int main()
3. {
4. int a, b, c;
5.
6. printf("Enter two numbers to addn");
7. scanf("%d%d",&a,&b);
8.
9. c = a + b;
10.
11. printf("Sum of entered numbers = %dn",c);
12.
13. return 0;
14. }
Memory
6
int c
Main Memory
5
Address
102543
142586
135545
135487
Arithmatic addition operation
1. #include<stdio.h>
2. int main()
3. {
4. int a, b, c;
5.
6. printf("Enter two numbers to addn");
7. scanf("%d%d",&a,&b);
8.
9. c = a + b;
10.
11. printf("Sum of entered numbers = %dn",c);
12.
13. return 0;
14. }
Memory
6
int c
Main Memory
5
Address
102543
142586
135545
135487
Arithmetic Addition Operation
6 5 =+ 11
Arithmetic addition operation
1. #include<stdio.h>
2. int main()
3. {
4. int a, b, c;
5.
6. printf("Enter two numbers to addn");
7. scanf("%d%d",&a,&b);
8.
9. c = a + b;
10.
11. printf("Sum of entered numbers = %dn",c);
12.
13. return 0;
14. }
Memory
6
11
Main Memory
5
Address
102543
142586
135545
135487
printf(...) is a function which is use to show any message to
the user.It shows the value of c variable to the user.
1. #include<stdio.h>
2. int main()
3. {
4. int a, b, c;
5.
6. printf("Enter two numbers to addn");
7. scanf("%d%d",&a,&b);
8.
9. c = a + b;
10.
11. printf("Sum of entered numbers = %dn",c);
12.
13. return 0;
14. }
Memory
Main Memory
Address
102543
142586
135545
135487
6
11
5
User’s console or cmd
give the value of c = 11 (answer)
Enter two numbers to add
6
5
Sum of entered numbers = 11
Press any key to continue . . .
It says that it is terminates the main() function and returns the
value 0.
1. #include<stdio.h>
2. int main()
3. {
4. int a, b, c;
5.
6. printf("Enter two numbers to addn");
7. scanf("%d%d",&a,&b);
8.
9. c = a + b;
10.
11. printf("Sum of entered numbers = %dn",c);
12.
13. return 0;
14. }
Memory
Main Memory
Address
102543
142586
135545
135487
6
11
5
last close brace of main function
1. #include<stdio.h>
2. int main()
3. {
4. int a, b, c;
5.
6. printf("Enter two numbers to addn");
7. scanf("%d%d",&a,&b);
8.
9. c = a + b;
10.
11. printf("Sum of entered numbers = %dn",c);
12.
13. return 0;
14. }
Memory
Main Memory
Address
102543
142586
135545
135487
6
11
5
Thank
You

More Related Content

What's hot (20)

Compiler design lab
Compiler design labCompiler design lab
Compiler design lab
ilias ahmed
 
اسلاید دوم جلسه پنجم کلاس پایتون برای هکرهای قانونی
اسلاید دوم جلسه پنجم کلاس پایتون برای هکرهای قانونیاسلاید دوم جلسه پنجم کلاس پایتون برای هکرهای قانونی
اسلاید دوم جلسه پنجم کلاس پایتون برای هکرهای قانونی
Mohammad Reza Kamalifard
 
Programming fundamentals
Programming fundamentalsProgramming fundamentals
Programming fundamentals
Zaibi Gondal
 
Computer Architecture and Organization lab with matlab
Computer Architecture and Organization lab with matlabComputer Architecture and Organization lab with matlab
Computer Architecture and Organization lab with matlab
Shankar Gangaju
 
Compiler Design Lab File
Compiler Design Lab FileCompiler Design Lab File
Compiler Design Lab File
Kandarp Tiwari
 
Activities on Operands
Activities on OperandsActivities on Operands
Activities on Operands
Nicole Ynne Estabillo
 
Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7
alish sha
 
88 c-programs
88 c-programs88 c-programs
88 c-programs
Leandro Schenone
 
week-1x
week-1xweek-1x
week-1x
KITE www.kitecolleges.com
 
Expressions using operator in c
Expressions using operator in cExpressions using operator in c
Expressions using operator in c
Saranya saran
 
Compiler design lab programs
Compiler design lab programs Compiler design lab programs
Compiler design lab programs
Guru Janbheshver University, Hisar
 
1 introduction to c program
1 introduction to c program1 introduction to c program
1 introduction to c program
NishmaNJ
 
week-10x
week-10xweek-10x
week-10x
KITE www.kitecolleges.com
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given number
Mainak Sasmal
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
pratikbakane
 
Programs that work in c and not in c
Programs that work in c and not in cPrograms that work in c and not in c
Programs that work in c and not in c
Ajay Chimmani
 
Practical no 6
Practical no 6Practical no 6
Practical no 6
Kshitija Dalvi
 
Adding two integers in c
Adding two integers in cAdding two integers in c
Adding two integers in c
Khuthbu Din
 
Core programming in c
Core programming in cCore programming in c
Core programming in c
Rahul Pandit
 
C exam
C examC exam
C exam
mohamed salem
 
Compiler design lab
Compiler design labCompiler design lab
Compiler design lab
ilias ahmed
 
اسلاید دوم جلسه پنجم کلاس پایتون برای هکرهای قانونی
اسلاید دوم جلسه پنجم کلاس پایتون برای هکرهای قانونیاسلاید دوم جلسه پنجم کلاس پایتون برای هکرهای قانونی
اسلاید دوم جلسه پنجم کلاس پایتون برای هکرهای قانونی
Mohammad Reza Kamalifard
 
Programming fundamentals
Programming fundamentalsProgramming fundamentals
Programming fundamentals
Zaibi Gondal
 
Computer Architecture and Organization lab with matlab
Computer Architecture and Organization lab with matlabComputer Architecture and Organization lab with matlab
Computer Architecture and Organization lab with matlab
Shankar Gangaju
 
Compiler Design Lab File
Compiler Design Lab FileCompiler Design Lab File
Compiler Design Lab File
Kandarp Tiwari
 
Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7
alish sha
 
Expressions using operator in c
Expressions using operator in cExpressions using operator in c
Expressions using operator in c
Saranya saran
 
1 introduction to c program
1 introduction to c program1 introduction to c program
1 introduction to c program
NishmaNJ
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given number
Mainak Sasmal
 
Programs that work in c and not in c
Programs that work in c and not in cPrograms that work in c and not in c
Programs that work in c and not in c
Ajay Chimmani
 
Adding two integers in c
Adding two integers in cAdding two integers in c
Adding two integers in c
Khuthbu Din
 
Core programming in c
Core programming in cCore programming in c
Core programming in c
Rahul Pandit
 

Viewers also liked (20)

C Programming Language Part 8
C Programming Language Part 8C Programming Language Part 8
C Programming Language Part 8
Rumman Ansari
 
C program compiler presentation
C program compiler presentationC program compiler presentation
C program compiler presentation
Rigvendra Kumar Vardhan
 
Steps for Developing a 'C' program
 Steps for Developing a 'C' program Steps for Developing a 'C' program
Steps for Developing a 'C' program
Sahithi Naraparaju
 
C Programming Language Part 9
C Programming Language Part 9C Programming Language Part 9
C Programming Language Part 9
Rumman Ansari
 
C Programming Language Part 5
C Programming Language Part 5C Programming Language Part 5
C Programming Language Part 5
Rumman Ansari
 
C Programming Language Part 11
C Programming Language Part 11C Programming Language Part 11
C Programming Language Part 11
Rumman Ansari
 
C Programming Language Step by Step Part 1
C Programming Language Step by Step Part 1C Programming Language Step by Step Part 1
C Programming Language Step by Step Part 1
Rumman Ansari
 
C Programming Language Part 6
C Programming Language Part 6C Programming Language Part 6
C Programming Language Part 6
Rumman Ansari
 
Basic c programming and explanation PPT1
Basic c programming and explanation PPT1Basic c programming and explanation PPT1
Basic c programming and explanation PPT1
Rumman Ansari
 
Steps for c program execution
Steps for c program executionSteps for c program execution
Steps for c program execution
Rumman Ansari
 
Properties EM
Properties EMProperties EM
Properties EM
tejas2019
 
Infrared spectoscopy
Infrared spectoscopyInfrared spectoscopy
Infrared spectoscopy
Rawat DA Greatt
 
Computational Spectroscopy in G03
Computational Spectroscopy in G03Computational Spectroscopy in G03
Computational Spectroscopy in G03
Inon Sharony
 
How To Start And Keep Conversations Going With Girls
How To Start And Keep Conversations Going With GirlsHow To Start And Keep Conversations Going With Girls
How To Start And Keep Conversations Going With Girls
George Hutton
 
Infrared spectroscopy
Infrared spectroscopyInfrared spectroscopy
Infrared spectroscopy
Rawat DA Greatt
 
COMPUTER PROGRAMMING UNIT 1 Lecture 1
COMPUTER PROGRAMMING UNIT 1 Lecture 1COMPUTER PROGRAMMING UNIT 1 Lecture 1
COMPUTER PROGRAMMING UNIT 1 Lecture 1
Vishal Patil
 
Software testing Training Syllabus Course
Software testing Training Syllabus CourseSoftware testing Training Syllabus Course
Software testing Training Syllabus Course
TOPS Technologies
 
Introduction to molecular spectroscopy
Introduction to molecular spectroscopyIntroduction to molecular spectroscopy
Introduction to molecular spectroscopy
Neel Kamal Kalita
 
Interpretation of IR
Interpretation of IRInterpretation of IR
Interpretation of IR
Lokesh Patil
 
INFRARED SPECTROSCOPY
INFRARED SPECTROSCOPYINFRARED SPECTROSCOPY
INFRARED SPECTROSCOPY
Nur Fatihah
 
C Programming Language Part 8
C Programming Language Part 8C Programming Language Part 8
C Programming Language Part 8
Rumman Ansari
 
Steps for Developing a 'C' program
 Steps for Developing a 'C' program Steps for Developing a 'C' program
Steps for Developing a 'C' program
Sahithi Naraparaju
 
C Programming Language Part 9
C Programming Language Part 9C Programming Language Part 9
C Programming Language Part 9
Rumman Ansari
 
C Programming Language Part 5
C Programming Language Part 5C Programming Language Part 5
C Programming Language Part 5
Rumman Ansari
 
C Programming Language Part 11
C Programming Language Part 11C Programming Language Part 11
C Programming Language Part 11
Rumman Ansari
 
C Programming Language Step by Step Part 1
C Programming Language Step by Step Part 1C Programming Language Step by Step Part 1
C Programming Language Step by Step Part 1
Rumman Ansari
 
C Programming Language Part 6
C Programming Language Part 6C Programming Language Part 6
C Programming Language Part 6
Rumman Ansari
 
Basic c programming and explanation PPT1
Basic c programming and explanation PPT1Basic c programming and explanation PPT1
Basic c programming and explanation PPT1
Rumman Ansari
 
Steps for c program execution
Steps for c program executionSteps for c program execution
Steps for c program execution
Rumman Ansari
 
Properties EM
Properties EMProperties EM
Properties EM
tejas2019
 
Computational Spectroscopy in G03
Computational Spectroscopy in G03Computational Spectroscopy in G03
Computational Spectroscopy in G03
Inon Sharony
 
How To Start And Keep Conversations Going With Girls
How To Start And Keep Conversations Going With GirlsHow To Start And Keep Conversations Going With Girls
How To Start And Keep Conversations Going With Girls
George Hutton
 
COMPUTER PROGRAMMING UNIT 1 Lecture 1
COMPUTER PROGRAMMING UNIT 1 Lecture 1COMPUTER PROGRAMMING UNIT 1 Lecture 1
COMPUTER PROGRAMMING UNIT 1 Lecture 1
Vishal Patil
 
Software testing Training Syllabus Course
Software testing Training Syllabus CourseSoftware testing Training Syllabus Course
Software testing Training Syllabus Course
TOPS Technologies
 
Introduction to molecular spectroscopy
Introduction to molecular spectroscopyIntroduction to molecular spectroscopy
Introduction to molecular spectroscopy
Neel Kamal Kalita
 
Interpretation of IR
Interpretation of IRInterpretation of IR
Interpretation of IR
Lokesh Patil
 
INFRARED SPECTROSCOPY
INFRARED SPECTROSCOPYINFRARED SPECTROSCOPY
INFRARED SPECTROSCOPY
Nur Fatihah
 
Ad

Similar to How c program execute in c program (20)

UNIT1 PPS of C language for first year first semester
UNIT1 PPS of C language for first year first semesterUNIT1 PPS of C language for first year first semester
UNIT1 PPS of C language for first year first semester
Aariz2
 
C Language Programming Introduction Lecture
C Language Programming Introduction LectureC Language Programming Introduction Lecture
C Language Programming Introduction Lecture
myinstalab
 
Introduction to Programming c language.pptx
Introduction to Programming c language.pptxIntroduction to Programming c language.pptx
Introduction to Programming c language.pptx
meesalasrinuvasuraon
 
presentation_data_types_and_operators_1513499834_241350.pptx
presentation_data_types_and_operators_1513499834_241350.pptxpresentation_data_types_and_operators_1513499834_241350.pptx
presentation_data_types_and_operators_1513499834_241350.pptx
KrishanPalSingh39
 
Najmul
Najmul  Najmul
Najmul
Najmul Ashik
 
Each n Every topic of C Programming.pptx
Each n Every topic of C Programming.pptxEach n Every topic of C Programming.pptx
Each n Every topic of C Programming.pptx
snnbarot
 
presentation_c_basics_1589366177_381682.pptx
presentation_c_basics_1589366177_381682.pptxpresentation_c_basics_1589366177_381682.pptx
presentation_c_basics_1589366177_381682.pptx
KrishanPalSingh39
 
C LANGUAGE.pptx
C LANGUAGE.pptxC LANGUAGE.pptx
C LANGUAGE.pptx
digitalworld70
 
C LANGUAGE.pptx
C LANGUAGE.pptxC LANGUAGE.pptx
C LANGUAGE.pptx
Learnwithjagrati
 
Module 1_Chapter 2_PPT (1)sasaddsdsds.pdf
Module 1_Chapter 2_PPT (1)sasaddsdsds.pdfModule 1_Chapter 2_PPT (1)sasaddsdsds.pdf
Module 1_Chapter 2_PPT (1)sasaddsdsds.pdf
anilcsbs
 
C language concept with code apna college.pdf
C language concept with code apna college.pdfC language concept with code apna college.pdf
C language concept with code apna college.pdf
mhande899
 
Fundamentals of Programming Constructs.pptx
Fundamentals of  Programming Constructs.pptxFundamentals of  Programming Constructs.pptx
Fundamentals of Programming Constructs.pptx
vijayapraba1
 
C SLIDES PREPARED BY M V B REDDY
C SLIDES PREPARED BY  M V B REDDYC SLIDES PREPARED BY  M V B REDDY
C SLIDES PREPARED BY M V B REDDY
Malikireddy Bramhananda Reddy
 
C BASICS.pptx FFDJF/,DKFF90DF SDPJKFJ[DSSIFLHDSHF
C BASICS.pptx FFDJF/,DKFF90DF SDPJKFJ[DSSIFLHDSHFC BASICS.pptx FFDJF/,DKFF90DF SDPJKFJ[DSSIFLHDSHF
C BASICS.pptx FFDJF/,DKFF90DF SDPJKFJ[DSSIFLHDSHF
AbcdR5
 
Ch2 introduction to c
Ch2 introduction to cCh2 introduction to c
Ch2 introduction to c
Hattori Sidek
 
Basic of C Programming | 2022 Updated | By Shamsul H. Ansari
Basic of C Programming | 2022 Updated | By Shamsul H. AnsariBasic of C Programming | 2022 Updated | By Shamsul H. Ansari
Basic of C Programming | 2022 Updated | By Shamsul H. Ansari
G. H. Raisoni Academy of Engineering & Technology, Nagpur
 
The basics of c programming
The basics of c programmingThe basics of c programming
The basics of c programming
Muhammed Thanveer M
 
Cse115 lecture04introtoc programming
Cse115 lecture04introtoc programmingCse115 lecture04introtoc programming
Cse115 lecture04introtoc programming
Md. Ashikur Rahman
 
4 Introduction to C.pptxSSSSSSSSSSSSSSSS
4 Introduction to C.pptxSSSSSSSSSSSSSSSS4 Introduction to C.pptxSSSSSSSSSSSSSSSS
4 Introduction to C.pptxSSSSSSSSSSSSSSSS
EG20910848921ISAACDU
 
Programming in C.pptx
Programming in C.pptxProgramming in C.pptx
Programming in C.pptx
TeresitaDapulase
 
UNIT1 PPS of C language for first year first semester
UNIT1 PPS of C language for first year first semesterUNIT1 PPS of C language for first year first semester
UNIT1 PPS of C language for first year first semester
Aariz2
 
C Language Programming Introduction Lecture
C Language Programming Introduction LectureC Language Programming Introduction Lecture
C Language Programming Introduction Lecture
myinstalab
 
Introduction to Programming c language.pptx
Introduction to Programming c language.pptxIntroduction to Programming c language.pptx
Introduction to Programming c language.pptx
meesalasrinuvasuraon
 
presentation_data_types_and_operators_1513499834_241350.pptx
presentation_data_types_and_operators_1513499834_241350.pptxpresentation_data_types_and_operators_1513499834_241350.pptx
presentation_data_types_and_operators_1513499834_241350.pptx
KrishanPalSingh39
 
Each n Every topic of C Programming.pptx
Each n Every topic of C Programming.pptxEach n Every topic of C Programming.pptx
Each n Every topic of C Programming.pptx
snnbarot
 
presentation_c_basics_1589366177_381682.pptx
presentation_c_basics_1589366177_381682.pptxpresentation_c_basics_1589366177_381682.pptx
presentation_c_basics_1589366177_381682.pptx
KrishanPalSingh39
 
Module 1_Chapter 2_PPT (1)sasaddsdsds.pdf
Module 1_Chapter 2_PPT (1)sasaddsdsds.pdfModule 1_Chapter 2_PPT (1)sasaddsdsds.pdf
Module 1_Chapter 2_PPT (1)sasaddsdsds.pdf
anilcsbs
 
C language concept with code apna college.pdf
C language concept with code apna college.pdfC language concept with code apna college.pdf
C language concept with code apna college.pdf
mhande899
 
Fundamentals of Programming Constructs.pptx
Fundamentals of  Programming Constructs.pptxFundamentals of  Programming Constructs.pptx
Fundamentals of Programming Constructs.pptx
vijayapraba1
 
C BASICS.pptx FFDJF/,DKFF90DF SDPJKFJ[DSSIFLHDSHF
C BASICS.pptx FFDJF/,DKFF90DF SDPJKFJ[DSSIFLHDSHFC BASICS.pptx FFDJF/,DKFF90DF SDPJKFJ[DSSIFLHDSHF
C BASICS.pptx FFDJF/,DKFF90DF SDPJKFJ[DSSIFLHDSHF
AbcdR5
 
Ch2 introduction to c
Ch2 introduction to cCh2 introduction to c
Ch2 introduction to c
Hattori Sidek
 
Cse115 lecture04introtoc programming
Cse115 lecture04introtoc programmingCse115 lecture04introtoc programming
Cse115 lecture04introtoc programming
Md. Ashikur Rahman
 
4 Introduction to C.pptxSSSSSSSSSSSSSSSS
4 Introduction to C.pptxSSSSSSSSSSSSSSSS4 Introduction to C.pptxSSSSSSSSSSSSSSSS
4 Introduction to C.pptxSSSSSSSSSSSSSSSS
EG20910848921ISAACDU
 
Ad

More from Rumman Ansari (18)

Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
Rumman Ansari
 
C programming exercises and solutions
C programming exercises and solutions C programming exercises and solutions
C programming exercises and solutions
Rumman Ansari
 
Java Tutorial best website
Java Tutorial best websiteJava Tutorial best website
Java Tutorial best website
Rumman Ansari
 
Java Questions and Answers
Java Questions and AnswersJava Questions and Answers
Java Questions and Answers
Rumman Ansari
 
servlet programming
servlet programmingservlet programming
servlet programming
Rumman Ansari
 
Pointer in c program
Pointer in c programPointer in c program
Pointer in c program
Rumman Ansari
 
What is token c programming
What is token c programmingWhat is token c programming
What is token c programming
Rumman Ansari
 
What is identifier c programming
What is identifier c programmingWhat is identifier c programming
What is identifier c programming
Rumman Ansari
 
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
 
Type casting in c programming
Type casting in c programmingType casting in c programming
Type casting in c programming
Rumman Ansari
 
C Programming Language Step by Step Part 5
C Programming Language Step by Step Part 5C Programming Language Step by Step Part 5
C Programming Language Step by Step Part 5
Rumman Ansari
 
C Programming Language Step by Step Part 3
C Programming Language Step by Step Part 3C Programming Language Step by Step Part 3
C Programming Language Step by Step Part 3
Rumman Ansari
 
C Programming Language Step by Step Part 2
C Programming Language Step by Step Part 2C Programming Language Step by Step Part 2
C Programming Language Step by Step Part 2
Rumman Ansari
 
C Programming
C ProgrammingC Programming
C Programming
Rumman Ansari
 
Tail recursion
Tail recursionTail recursion
Tail recursion
Rumman Ansari
 
Tail Recursion in data structure
Tail Recursion in data structureTail Recursion in data structure
Tail Recursion in data structure
Rumman Ansari
 
Spyware manual
Spyware  manualSpyware  manual
Spyware manual
Rumman Ansari
 
Linked list
Linked listLinked list
Linked list
Rumman Ansari
 
C programming exercises and solutions
C programming exercises and solutions C programming exercises and solutions
C programming exercises and solutions
Rumman Ansari
 
Java Tutorial best website
Java Tutorial best websiteJava Tutorial best website
Java Tutorial best website
Rumman Ansari
 
Java Questions and Answers
Java Questions and AnswersJava Questions and Answers
Java Questions and Answers
Rumman Ansari
 
Pointer in c program
Pointer in c programPointer in c program
Pointer in c program
Rumman Ansari
 
What is token c programming
What is token c programmingWhat is token c programming
What is token c programming
Rumman Ansari
 
What is identifier c programming
What is identifier c programmingWhat is identifier c programming
What is identifier c programming
Rumman Ansari
 
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
 
Type casting in c programming
Type casting in c programmingType casting in c programming
Type casting in c programming
Rumman Ansari
 
C Programming Language Step by Step Part 5
C Programming Language Step by Step Part 5C Programming Language Step by Step Part 5
C Programming Language Step by Step Part 5
Rumman Ansari
 
C Programming Language Step by Step Part 3
C Programming Language Step by Step Part 3C Programming Language Step by Step Part 3
C Programming Language Step by Step Part 3
Rumman Ansari
 
C Programming Language Step by Step Part 2
C Programming Language Step by Step Part 2C Programming Language Step by Step Part 2
C Programming Language Step by Step Part 2
Rumman Ansari
 
Tail Recursion in data structure
Tail Recursion in data structureTail Recursion in data structure
Tail Recursion in data structure
Rumman Ansari
 

Recently uploaded (20)

Introduction of Structural Audit and Health Montoring.pptx
Introduction of Structural Audit and Health Montoring.pptxIntroduction of Structural Audit and Health Montoring.pptx
Introduction of Structural Audit and Health Montoring.pptx
gunjalsachin
 
Proposed EPA Municipal Waste Combustor Rule
Proposed EPA Municipal Waste Combustor RuleProposed EPA Municipal Waste Combustor Rule
Proposed EPA Municipal Waste Combustor Rule
AlvaroLinero2
 
ENERGY STORING DEVICES-Primary Battery.pdf
ENERGY STORING DEVICES-Primary Battery.pdfENERGY STORING DEVICES-Primary Battery.pdf
ENERGY STORING DEVICES-Primary Battery.pdf
TAMILISAI R
 
Electrical and Electronics Engineering: An International Journal (ELELIJ)
Electrical and Electronics Engineering: An International Journal (ELELIJ)Electrical and Electronics Engineering: An International Journal (ELELIJ)
Electrical and Electronics Engineering: An International Journal (ELELIJ)
elelijjournal653
 
Pruebas y Solucion de problemas empresariales en redes de Fibra Optica
Pruebas y Solucion de problemas empresariales en redes de Fibra OpticaPruebas y Solucion de problemas empresariales en redes de Fibra Optica
Pruebas y Solucion de problemas empresariales en redes de Fibra Optica
OmarAlfredoDelCastil
 
Video Games and Artificial-Realities.pptx
Video Games and Artificial-Realities.pptxVideo Games and Artificial-Realities.pptx
Video Games and Artificial-Realities.pptx
HadiBadri1
 
UNIT-1-PPT-Introduction about Power System Operation and Control
UNIT-1-PPT-Introduction about Power System Operation and ControlUNIT-1-PPT-Introduction about Power System Operation and Control
UNIT-1-PPT-Introduction about Power System Operation and Control
Sridhar191373
 
[HIFLUX] Lok Fitting&Valve Catalog 2025 (Eng)
[HIFLUX] Lok Fitting&Valve Catalog 2025 (Eng)[HIFLUX] Lok Fitting&Valve Catalog 2025 (Eng)
[HIFLUX] Lok Fitting&Valve Catalog 2025 (Eng)
하이플럭스 / HIFLUX Co., Ltd.
 
Direct Current circuitsDirect Current circuitsDirect Current circuitsDirect C...
Direct Current circuitsDirect Current circuitsDirect Current circuitsDirect C...Direct Current circuitsDirect Current circuitsDirect Current circuitsDirect C...
Direct Current circuitsDirect Current circuitsDirect Current circuitsDirect C...
BeHappy728244
 
What is dbms architecture, components of dbms architecture and types of dbms ...
What is dbms architecture, components of dbms architecture and types of dbms ...What is dbms architecture, components of dbms architecture and types of dbms ...
What is dbms architecture, components of dbms architecture and types of dbms ...
cyhuutjdoazdwrnubt
 
HVAC Air Filter Equipment-Catalouge-Final.pdf
HVAC Air Filter Equipment-Catalouge-Final.pdfHVAC Air Filter Equipment-Catalouge-Final.pdf
HVAC Air Filter Equipment-Catalouge-Final.pdf
FILTRATION ENGINEERING & CUNSULTANT
 
Tesia Dobrydnia - A Leader In Her Industry
Tesia Dobrydnia - A Leader In Her IndustryTesia Dobrydnia - A Leader In Her Industry
Tesia Dobrydnia - A Leader In Her Industry
Tesia Dobrydnia
 
Webinar On Steel Melting IIF of steel for rdso
Webinar  On Steel  Melting IIF of steel for rdsoWebinar  On Steel  Melting IIF of steel for rdso
Webinar On Steel Melting IIF of steel for rdso
KapilParyani3
 
May 2025: Top 10 Cited Articles in Software Engineering & Applications Intern...
May 2025: Top 10 Cited Articles in Software Engineering & Applications Intern...May 2025: Top 10 Cited Articles in Software Engineering & Applications Intern...
May 2025: Top 10 Cited Articles in Software Engineering & Applications Intern...
sebastianku31
 
ISO 5011 Air Filter Catalogues .pdf
ISO 5011 Air Filter Catalogues      .pdfISO 5011 Air Filter Catalogues      .pdf
ISO 5011 Air Filter Catalogues .pdf
FILTRATION ENGINEERING & CUNSULTANT
 
Influence line diagram for truss in a robust
Influence line diagram for truss in a robustInfluence line diagram for truss in a robust
Influence line diagram for truss in a robust
ParthaSengupta26
 
ISO 4548-7 Filter Vibration Fatigue Test Rig Catalogue.pdf
ISO 4548-7 Filter Vibration Fatigue Test Rig Catalogue.pdfISO 4548-7 Filter Vibration Fatigue Test Rig Catalogue.pdf
ISO 4548-7 Filter Vibration Fatigue Test Rig Catalogue.pdf
FILTRATION ENGINEERING & CUNSULTANT
 
하이플럭스 락피팅 카달로그 2025 (Lok Fitting Catalog 2025)
하이플럭스 락피팅 카달로그 2025 (Lok Fitting Catalog 2025)하이플럭스 락피팅 카달로그 2025 (Lok Fitting Catalog 2025)
하이플럭스 락피팅 카달로그 2025 (Lok Fitting Catalog 2025)
하이플럭스 / HIFLUX Co., Ltd.
 
MODULE 4 BUILDING PLANNING AND DESIGN SY BTECH HVAC SYSTEM IN BUILDING
MODULE 4 BUILDING PLANNING AND DESIGN SY BTECH HVAC SYSTEM IN BUILDINGMODULE 4 BUILDING PLANNING AND DESIGN SY BTECH HVAC SYSTEM IN BUILDING
MODULE 4 BUILDING PLANNING AND DESIGN SY BTECH HVAC SYSTEM IN BUILDING
Dr. BASWESHWAR JIRWANKAR
 
Axial Capacity Estimation of FRP-strengthened Corroded Concrete Columns
Axial Capacity Estimation of FRP-strengthened Corroded Concrete ColumnsAxial Capacity Estimation of FRP-strengthened Corroded Concrete Columns
Axial Capacity Estimation of FRP-strengthened Corroded Concrete Columns
Journal of Soft Computing in Civil Engineering
 
Introduction of Structural Audit and Health Montoring.pptx
Introduction of Structural Audit and Health Montoring.pptxIntroduction of Structural Audit and Health Montoring.pptx
Introduction of Structural Audit and Health Montoring.pptx
gunjalsachin
 
Proposed EPA Municipal Waste Combustor Rule
Proposed EPA Municipal Waste Combustor RuleProposed EPA Municipal Waste Combustor Rule
Proposed EPA Municipal Waste Combustor Rule
AlvaroLinero2
 
ENERGY STORING DEVICES-Primary Battery.pdf
ENERGY STORING DEVICES-Primary Battery.pdfENERGY STORING DEVICES-Primary Battery.pdf
ENERGY STORING DEVICES-Primary Battery.pdf
TAMILISAI R
 
Electrical and Electronics Engineering: An International Journal (ELELIJ)
Electrical and Electronics Engineering: An International Journal (ELELIJ)Electrical and Electronics Engineering: An International Journal (ELELIJ)
Electrical and Electronics Engineering: An International Journal (ELELIJ)
elelijjournal653
 
Pruebas y Solucion de problemas empresariales en redes de Fibra Optica
Pruebas y Solucion de problemas empresariales en redes de Fibra OpticaPruebas y Solucion de problemas empresariales en redes de Fibra Optica
Pruebas y Solucion de problemas empresariales en redes de Fibra Optica
OmarAlfredoDelCastil
 
Video Games and Artificial-Realities.pptx
Video Games and Artificial-Realities.pptxVideo Games and Artificial-Realities.pptx
Video Games and Artificial-Realities.pptx
HadiBadri1
 
UNIT-1-PPT-Introduction about Power System Operation and Control
UNIT-1-PPT-Introduction about Power System Operation and ControlUNIT-1-PPT-Introduction about Power System Operation and Control
UNIT-1-PPT-Introduction about Power System Operation and Control
Sridhar191373
 
Direct Current circuitsDirect Current circuitsDirect Current circuitsDirect C...
Direct Current circuitsDirect Current circuitsDirect Current circuitsDirect C...Direct Current circuitsDirect Current circuitsDirect Current circuitsDirect C...
Direct Current circuitsDirect Current circuitsDirect Current circuitsDirect C...
BeHappy728244
 
What is dbms architecture, components of dbms architecture and types of dbms ...
What is dbms architecture, components of dbms architecture and types of dbms ...What is dbms architecture, components of dbms architecture and types of dbms ...
What is dbms architecture, components of dbms architecture and types of dbms ...
cyhuutjdoazdwrnubt
 
Tesia Dobrydnia - A Leader In Her Industry
Tesia Dobrydnia - A Leader In Her IndustryTesia Dobrydnia - A Leader In Her Industry
Tesia Dobrydnia - A Leader In Her Industry
Tesia Dobrydnia
 
Webinar On Steel Melting IIF of steel for rdso
Webinar  On Steel  Melting IIF of steel for rdsoWebinar  On Steel  Melting IIF of steel for rdso
Webinar On Steel Melting IIF of steel for rdso
KapilParyani3
 
May 2025: Top 10 Cited Articles in Software Engineering & Applications Intern...
May 2025: Top 10 Cited Articles in Software Engineering & Applications Intern...May 2025: Top 10 Cited Articles in Software Engineering & Applications Intern...
May 2025: Top 10 Cited Articles in Software Engineering & Applications Intern...
sebastianku31
 
Influence line diagram for truss in a robust
Influence line diagram for truss in a robustInfluence line diagram for truss in a robust
Influence line diagram for truss in a robust
ParthaSengupta26
 
하이플럭스 락피팅 카달로그 2025 (Lok Fitting Catalog 2025)
하이플럭스 락피팅 카달로그 2025 (Lok Fitting Catalog 2025)하이플럭스 락피팅 카달로그 2025 (Lok Fitting Catalog 2025)
하이플럭스 락피팅 카달로그 2025 (Lok Fitting Catalog 2025)
하이플럭스 / HIFLUX Co., Ltd.
 
MODULE 4 BUILDING PLANNING AND DESIGN SY BTECH HVAC SYSTEM IN BUILDING
MODULE 4 BUILDING PLANNING AND DESIGN SY BTECH HVAC SYSTEM IN BUILDINGMODULE 4 BUILDING PLANNING AND DESIGN SY BTECH HVAC SYSTEM IN BUILDING
MODULE 4 BUILDING PLANNING AND DESIGN SY BTECH HVAC SYSTEM IN BUILDING
Dr. BASWESHWAR JIRWANKAR
 

How c program execute in c program

  • 2. To type your C program you need a program called Editor Example: Notepad Notepad++ or any IDE
  • 3. Once the program has been typed it needs to be converted to machine language (0s and 1s) before the machine can execute it .
  • 4. To carry out this conversion we need another program called Compiler. Compiler vendors provide an Integrated Development Environment (IDE) which consists of an Editor as well as the Compiler. Compiler Example: gcc IDE Example: Turbo C, Visual C++ , Borland C++
  • 5. Write down program in IDE and save it with extension(.c) example: program_name.c
  • 6. 1. #include<stdio.h> 2. int main() 3. { 4. int a, b, c; 5. 6. printf("Enter two numbers to addn"); 7. scanf("%d%d",&a,&b); 8. 9. c = a + b; 10. 11. printf("Sum of entered numbers = %dn",c); 12. 13. return 0; 14. }
  • 8. Compile Completed no error is detected and object file also created Example: program_name.obj
  • 10. 1. #include<stdio.h> 2. int main() 3. { 4. int a, b, c; 5. 6. printf("Enter two numbers to addn"); 7. scanf("%d%d",&a,&b); 8. 9. c = a + b; 10. 11. printf("Sum of entered numbers = %dn",c); 12. 13. return 0; 14. } Main Memory Memory Address 102543 142586 135545 135487
  • 11. It is a preprocessor command 1. #include<stdio.h> 2. int main() 3. { 4. int a, b, c; 5. 6. printf("Enter two numbers to addn"); 7. scanf("%d%d",&a,&b); 8. 9. c = a + b; 10. 11. printf("Sum of entered numbers = %dn",c); 12. 13. return 0; 14. } Main Memory Memory Address 102543 142586 135545 135487
  • 12. It is the main function where the program execution begins 1. #include<stdio.h> 2. int main() 3. { 4. int a, b, c; 5. 6. printf("Enter two numbers to addn"); 7. scanf("%d%d",&a,&b); 8. 9. c = a + b; 10. 11. printf("Sum of entered numbers = %dn",c); 12. 13. return 0; 14. } Main Memory Memory Address 102543 142586 135545 135487
  • 13. First open brace of main function 1. #include<stdio.h> 2. int main() 3. { 4. int a, b, c; 5. 6. printf("Enter two numbers to addn"); 7. scanf("%d%d",&a,&b); 8. 9. c = a + b; 10. 11. printf("Sum of entered numbers = %dn",c); 12. 13. return 0; 14. } Main Memory Memory Address 102543 142586 135545 135487
  • 14. Memory allocation for three variable a,b,c 1. #include<stdio.h> 2. int main() 3. { 4. int a, b, c; 5. 6. printf("Enter two numbers to addn"); 7. scanf("%d%d",&a,&b); 8. 9. c = a + b; 10. 11. printf("Sum of entered numbers = %dn",c); 12. 13. return 0; 14. } Memory int a int c Main Memory int b Address 102543 142586 135545 135487
  • 15. printf(...) is a function which is use to show any message to the user 1. #include<stdio.h> 2. int main() 3. { 4. int a, b, c; 5. 6. printf("Enter two numbers to addn"); 7. scanf("%d%d",&a,&b); 8. 9. c = a + b; 10. 11. printf("Sum of entered numbers = %dn",c); 12. 13. return 0; 14. } Memory int a int c Main Memory int b Address 102543 142586 135545 135487
  • 16. User’s console or cmd message to the user Enter two numbers to add
  • 17. scanf(...) is another function available in C which is use to take value form user by keyboard 1. #include<stdio.h> 2. int main() 3. { 4. int a, b, c; 5. 6. printf("Enter two numbers to addn"); 7. scanf("%d%d",&a,&b); 8. 9. c = a + b; 10. 11. printf("Sum of entered numbers = %dn",c); 12. 13. return 0; 14. } Memory int a int c Main Memory int b Address 102543 142586 135545 135487
  • 18. User’s console or cmd give the value of a=6 and b=5 Enter two numbers to add 6 5
  • 19. Insertion of a and b in memory 1. #include<stdio.h> 2. int main() 3. { 4. int a, b, c; 5. 6. printf("Enter two numbers to addn"); 7. scanf("%d%d",&a,&b); 8. 9. c = a + b; 10. 11. printf("Sum of entered numbers = %dn",c); 12. 13. return 0; 14. } Memory int a int c Main Memory int b Address 102543 142586 135545 135487
  • 20. Insertion of a and b in memory 1. #include<stdio.h> 2. int main() 3. { 4. int a, b, c; 5. 6. printf("Enter two numbers to addn"); 7. scanf("%d%d",&a,&b); 8. 9. c = a + b; 10. 11. printf("Sum of entered numbers = %dn",c); 12. 13. return 0; 14. } Memory 6 int c Main Memory 5 Address 102543 142586 135545 135487
  • 21. Arithmatic addition operation 1. #include<stdio.h> 2. int main() 3. { 4. int a, b, c; 5. 6. printf("Enter two numbers to addn"); 7. scanf("%d%d",&a,&b); 8. 9. c = a + b; 10. 11. printf("Sum of entered numbers = %dn",c); 12. 13. return 0; 14. } Memory 6 int c Main Memory 5 Address 102543 142586 135545 135487
  • 23. Arithmetic addition operation 1. #include<stdio.h> 2. int main() 3. { 4. int a, b, c; 5. 6. printf("Enter two numbers to addn"); 7. scanf("%d%d",&a,&b); 8. 9. c = a + b; 10. 11. printf("Sum of entered numbers = %dn",c); 12. 13. return 0; 14. } Memory 6 11 Main Memory 5 Address 102543 142586 135545 135487
  • 24. printf(...) is a function which is use to show any message to the user.It shows the value of c variable to the user. 1. #include<stdio.h> 2. int main() 3. { 4. int a, b, c; 5. 6. printf("Enter two numbers to addn"); 7. scanf("%d%d",&a,&b); 8. 9. c = a + b; 10. 11. printf("Sum of entered numbers = %dn",c); 12. 13. return 0; 14. } Memory Main Memory Address 102543 142586 135545 135487 6 11 5
  • 25. User’s console or cmd give the value of c = 11 (answer) Enter two numbers to add 6 5 Sum of entered numbers = 11 Press any key to continue . . .
  • 26. It says that it is terminates the main() function and returns the value 0. 1. #include<stdio.h> 2. int main() 3. { 4. int a, b, c; 5. 6. printf("Enter two numbers to addn"); 7. scanf("%d%d",&a,&b); 8. 9. c = a + b; 10. 11. printf("Sum of entered numbers = %dn",c); 12. 13. return 0; 14. } Memory Main Memory Address 102543 142586 135545 135487 6 11 5
  • 27. last close brace of main function 1. #include<stdio.h> 2. int main() 3. { 4. int a, b, c; 5. 6. printf("Enter two numbers to addn"); 7. scanf("%d%d",&a,&b); 8. 9. c = a + b; 10. 11. printf("Sum of entered numbers = %dn",c); 12. 13. return 0; 14. } Memory Main Memory Address 102543 142586 135545 135487 6 11 5