SlideShare a Scribd company logo
1 | P a g e
ENG. Keroles Shenouda
https://www.facebook.com/groups/embedded.system.KS/
C PROGRAMMING FIRST SESSION QUIZ
QUESTIONS
1) What is the compiler?
2) What is meant by native compiler and cross compiler?
3) What are the steps of compiling? Illustrate the steps as much as you can.
4) Explain briefly preprocessor?
5) What is meant by libraries?
6) Why using ‘C’ language specifically with embedded systems?
7) What will be the output of the following code:
Include <stdio.h>
Int main ()
{
printf(“hello world”);
return 0;
}
2 | P a g e
ENG. Keroles Shenouda
https://www.facebook.com/groups/embedded.system.KS/
ANSWERS
1) Compiler is simply a translator that translates the ‘C’ language or any language to the
targeted machine code.
Example: c language compiled to work on Atmel AVR so that means ‘C’ translated to
Atmel AVR assembly then converted to obj file and finally hex file that is flashed to
the microctroller.
Compiling a code is consisting of steps.
2) Native compiler: is the compiler that is compiling the current code to the current
machine code to work “only” on the current machine and no other machine
Cross compiler: means that this compiler will compile the code to work on another
machine like in case of writing code to work on other microcontroller.
3) preprocessing
The first stage of compilation is called preprocessing. In this stage, lines starting with
a # character are interpreted by the preprocessor as preprocessor commands. These
commands form a simple macro language with its own syntax and semantics.
compilation
The second stage of compilation is confusingly enough called compilation. In this
stage, the preprocessed code is translated to assembly instructions specific to the
target processor architecture. These form an intermediate human readable language.
Assembly
During the assembly stage, an assembler is used to translate the assembly instructions
to machine code, or object code. The output consists of actual instructions to be run
by the target processor.
linking
The object code generated in the assembly stage is composed of machine instructions
that the processor understands but some pieces of the program are out of order or
missing. To produce an executable program, the existing pieces have to be rearranged
and the missing ones filled in. This process is called linking.
3 | P a g e
ENG. Keroles Shenouda
https://www.facebook.com/groups/embedded.system.KS/
The linker will arrange the pieces of object code so that functions in some pieces can
successfully call functions in other pieces. It will also add pieces containing the
instructions for library functions used by the program
4) preprocessing
The first stage of compilation is called preprocessing. In this stage, lines starting with
a # character are interpreted by the preprocessor as preprocessor commands. These
commands form a simple macro language with its own syntax and semantics.
5) A library in C is a group of functions and declarations, exposed for use by other
programs. The library therefore consists of an interface expressed in a .h file (named
the "header") and an implementation expressed in a .c file. This .c file might be
precompiled or otherwise inaccessible, or it might be available to the programmer.
(Note: Libraries may call functions in other libraries such as the Standard C or math
libraries to do various tasks.)
6) “C” language is powerful it has the ability to access memory directly using pointers
Secondly is that “C” is portable and have many compilers that translates the “C” to
other machines: microcontrollers assembly.
7) The code will not run as the “#” is missing from the code
4 | P a g e
ENG. Keroles Shenouda
https://www.facebook.com/groups/embedded.system.KS/

More Related Content

What's hot

Quiz 9
Quiz 9Quiz 9
Embedded c
Embedded cEmbedded c
Embedded c
Nandan Desai
 
Embedded C - Lecture 4
Embedded C - Lecture 4Embedded C - Lecture 4
Embedded C - Lecture 4
Mohamed Abdallah
 
C programming part2
C programming part2C programming part2
C programming part2
Keroles karam khalil
 
Embedded c program and programming structure for beginners
Embedded c program and programming structure for beginnersEmbedded c program and programming structure for beginners
Embedded c program and programming structure for beginners
Kamesh Mtec
 
Embedded c programming
Embedded c programmingEmbedded c programming
Embedded c programming
PriyaDYP
 
Lesson 7 io statements
Lesson 7 io statementsLesson 7 io statements
Lesson 7 io statements
Dr. Rupinder Singh
 
Fortran - concise review
Fortran - concise reviewFortran - concise review
Fortran - concise review
Hans Zimermann
 
Introduction to C Language - Version 1.0 by Mark John Lado
Introduction to C Language - Version 1.0 by Mark John LadoIntroduction to C Language - Version 1.0 by Mark John Lado
Introduction to C Language - Version 1.0 by Mark John Lado
Mark John Lado, MIT
 
Seminar Fortran and Julia
Seminar Fortran and JuliaSeminar Fortran and Julia
Seminar Fortran and Julia
Krissia Zawadzki
 
Embedded c programming22 for fdp
Embedded c programming22 for fdpEmbedded c programming22 for fdp
Embedded c programming22 for fdpPradeep Kumar TS
 
C programming interview questions
C programming interview questionsC programming interview questions
C programming interview questions
adarshynl
 
Fortran 95
Fortran 95Fortran 95
Fortran 95
Zaahir Salam
 
15ss
15ss15ss
Macro
MacroMacro
C++ Tutorial
C++ TutorialC++ Tutorial
C++ Tutorial
freema48
 
Compiler unit 4
Compiler unit 4Compiler unit 4
Compiler unit 4
BBDITM LUCKNOW
 

What's hot (17)

Quiz 9
Quiz 9Quiz 9
Quiz 9
 
Embedded c
Embedded cEmbedded c
Embedded c
 
Embedded C - Lecture 4
Embedded C - Lecture 4Embedded C - Lecture 4
Embedded C - Lecture 4
 
C programming part2
C programming part2C programming part2
C programming part2
 
Embedded c program and programming structure for beginners
Embedded c program and programming structure for beginnersEmbedded c program and programming structure for beginners
Embedded c program and programming structure for beginners
 
Embedded c programming
Embedded c programmingEmbedded c programming
Embedded c programming
 
Lesson 7 io statements
Lesson 7 io statementsLesson 7 io statements
Lesson 7 io statements
 
Fortran - concise review
Fortran - concise reviewFortran - concise review
Fortran - concise review
 
Introduction to C Language - Version 1.0 by Mark John Lado
Introduction to C Language - Version 1.0 by Mark John LadoIntroduction to C Language - Version 1.0 by Mark John Lado
Introduction to C Language - Version 1.0 by Mark John Lado
 
Seminar Fortran and Julia
Seminar Fortran and JuliaSeminar Fortran and Julia
Seminar Fortran and Julia
 
Embedded c programming22 for fdp
Embedded c programming22 for fdpEmbedded c programming22 for fdp
Embedded c programming22 for fdp
 
C programming interview questions
C programming interview questionsC programming interview questions
C programming interview questions
 
Fortran 95
Fortran 95Fortran 95
Fortran 95
 
15ss
15ss15ss
15ss
 
Macro
MacroMacro
Macro
 
C++ Tutorial
C++ TutorialC++ Tutorial
C++ Tutorial
 
Compiler unit 4
Compiler unit 4Compiler unit 4
Compiler unit 4
 

Similar to First session quiz

INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfINTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
Subramanyambharathis
 
Language translators
Language translatorsLanguage translators
Language translatorsAditya Sharat
 
WEBSITE DEVELOPMENT
WEBSITE DEVELOPMENTWEBSITE DEVELOPMENT
WEBSITE DEVELOPMENT
shahzadebaujiti
 
INTRODUCTION TO C LANGUAGE.pptx
INTRODUCTION TO C LANGUAGE.pptxINTRODUCTION TO C LANGUAGE.pptx
INTRODUCTION TO C LANGUAGE.pptx
MohammedtajuddinTaju
 
CS8251_QB_answers.pdf
CS8251_QB_answers.pdfCS8251_QB_answers.pdf
CS8251_QB_answers.pdf
vino108206
 
Introduction of c language
Introduction of c languageIntroduction of c language
Introduction of c language
farishah
 
Source vs object code
Source vs object codeSource vs object code
Source vs object code
Sana Ullah
 
Chapter 2 Program language translation.pptx
Chapter 2 Program language translation.pptxChapter 2 Program language translation.pptx
Chapter 2 Program language translation.pptx
dawod yimer
 
C Programming UNIT 1.pptx
C Programming  UNIT 1.pptxC Programming  UNIT 1.pptx
C Programming UNIT 1.pptx
Mugilvannan11
 
Phases of Compiler
Phases of CompilerPhases of Compiler
Phases of Compiler
A. S. M. Shafi
 
Chapter1.pdf
Chapter1.pdfChapter1.pdf
Chapter1.pdf
tharwatabdulhmed
 
Introduction To C++ programming and its basic concepts
Introduction To C++ programming and its basic conceptsIntroduction To C++ programming and its basic concepts
Introduction To C++ programming and its basic concepts
ssuserf86fba
 
Declare Your Language: What is a Compiler?
Declare Your Language: What is a Compiler?Declare Your Language: What is a Compiler?
Declare Your Language: What is a Compiler?
Eelco Visser
 
Basics of C Lecture 2[16097].pptx
Basics of C Lecture 2[16097].pptxBasics of C Lecture 2[16097].pptx
Basics of C Lecture 2[16097].pptx
CoolGamer16
 
Programming in C
Programming in CProgramming in C
Programming in C
Rvishnupriya2
 
Programming in c
Programming in cProgramming in c
Programming in c
vishnu973656
 
Ss ui lecture 1
Ss ui lecture 1Ss ui lecture 1
Ss ui lecture 1
Avinash Kapse
 
C lecture notes new
C lecture notes newC lecture notes new
C lecture notes new
Kuntal Bhowmick
 
Introduction to c language
Introduction to c language Introduction to c language
Introduction to c language
BAKRANIYA KALPESH
 

Similar to First session quiz (20)

INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfINTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
 
Language translators
Language translatorsLanguage translators
Language translators
 
WEBSITE DEVELOPMENT
WEBSITE DEVELOPMENTWEBSITE DEVELOPMENT
WEBSITE DEVELOPMENT
 
INTRODUCTION TO C LANGUAGE.pptx
INTRODUCTION TO C LANGUAGE.pptxINTRODUCTION TO C LANGUAGE.pptx
INTRODUCTION TO C LANGUAGE.pptx
 
CS8251_QB_answers.pdf
CS8251_QB_answers.pdfCS8251_QB_answers.pdf
CS8251_QB_answers.pdf
 
Introduction of c language
Introduction of c languageIntroduction of c language
Introduction of c language
 
Source vs object code
Source vs object codeSource vs object code
Source vs object code
 
Chapter 2 Program language translation.pptx
Chapter 2 Program language translation.pptxChapter 2 Program language translation.pptx
Chapter 2 Program language translation.pptx
 
C Programming UNIT 1.pptx
C Programming  UNIT 1.pptxC Programming  UNIT 1.pptx
C Programming UNIT 1.pptx
 
Phases of Compiler
Phases of CompilerPhases of Compiler
Phases of Compiler
 
Chapter1.pdf
Chapter1.pdfChapter1.pdf
Chapter1.pdf
 
Introduction To C++ programming and its basic concepts
Introduction To C++ programming and its basic conceptsIntroduction To C++ programming and its basic concepts
Introduction To C++ programming and its basic concepts
 
Declare Your Language: What is a Compiler?
Declare Your Language: What is a Compiler?Declare Your Language: What is a Compiler?
Declare Your Language: What is a Compiler?
 
Basics of C Lecture 2[16097].pptx
Basics of C Lecture 2[16097].pptxBasics of C Lecture 2[16097].pptx
Basics of C Lecture 2[16097].pptx
 
Programming in C
Programming in CProgramming in C
Programming in C
 
Programming in c
Programming in cProgramming in c
Programming in c
 
Ss ui lecture 1
Ss ui lecture 1Ss ui lecture 1
Ss ui lecture 1
 
SS UI Lecture 1
SS UI Lecture 1SS UI Lecture 1
SS UI Lecture 1
 
C lecture notes new
C lecture notes newC lecture notes new
C lecture notes new
 
Introduction to c language
Introduction to c language Introduction to c language
Introduction to c language
 

More from Keroles karam khalil

C basics quiz part 1_solution
C basics quiz part 1_solutionC basics quiz part 1_solution
C basics quiz part 1_solution
Keroles karam khalil
 
Autosar Basics hand book_v1
Autosar Basics  hand book_v1Autosar Basics  hand book_v1
Autosar Basics hand book_v1
Keroles karam khalil
 
Automotive embedded systems part6 v2
Automotive embedded systems part6 v2Automotive embedded systems part6 v2
Automotive embedded systems part6 v2
Keroles karam khalil
 
Automotive embedded systems part5 v2
Automotive embedded systems part5 v2Automotive embedded systems part5 v2
Automotive embedded systems part5 v2
Keroles karam khalil
 
Automotive embedded systems part7 v1
Automotive embedded systems part7 v1Automotive embedded systems part7 v1
Automotive embedded systems part7 v1
Keroles karam khalil
 
Automotive embedded systems part6 v1
Automotive embedded systems part6 v1Automotive embedded systems part6 v1
Automotive embedded systems part6 v1
Keroles karam khalil
 
Automotive embedded systems part5 v1
Automotive embedded systems part5 v1Automotive embedded systems part5 v1
Automotive embedded systems part5 v1
Keroles karam khalil
 
Automotive embedded systems part4 v1
Automotive embedded systems part4 v1Automotive embedded systems part4 v1
Automotive embedded systems part4 v1
Keroles karam khalil
 
Automotive embedded systems part3 v1
Automotive embedded systems part3 v1Automotive embedded systems part3 v1
Automotive embedded systems part3 v1
Keroles karam khalil
 
Automotive embedded systems part2 v1
Automotive embedded systems part2 v1Automotive embedded systems part2 v1
Automotive embedded systems part2 v1
Keroles karam khalil
 
Automotive embedded systems part1 v1
Automotive embedded systems part1 v1Automotive embedded systems part1 v1
Automotive embedded systems part1 v1
Keroles karam khalil
 
Automotive embedded systems part8 v1
Automotive embedded systems part8 v1Automotive embedded systems part8 v1
Automotive embedded systems part8 v1
Keroles karam khalil
 
Quiz 10
Quiz 10Quiz 10
Homework 6
Homework 6Homework 6
Homework 5 solution
Homework 5 solutionHomework 5 solution
Homework 5 solution
Keroles karam khalil
 
Notes part7
Notes part7Notes part7
Homework 5
Homework 5Homework 5
C programming session7
C programming  session7C programming  session7
C programming session7
Keroles karam khalil
 
Notes part6
Notes part6Notes part6
Homework 4 solution
Homework 4 solutionHomework 4 solution
Homework 4 solution
Keroles karam khalil
 

More from Keroles karam khalil (20)

C basics quiz part 1_solution
C basics quiz part 1_solutionC basics quiz part 1_solution
C basics quiz part 1_solution
 
Autosar Basics hand book_v1
Autosar Basics  hand book_v1Autosar Basics  hand book_v1
Autosar Basics hand book_v1
 
Automotive embedded systems part6 v2
Automotive embedded systems part6 v2Automotive embedded systems part6 v2
Automotive embedded systems part6 v2
 
Automotive embedded systems part5 v2
Automotive embedded systems part5 v2Automotive embedded systems part5 v2
Automotive embedded systems part5 v2
 
Automotive embedded systems part7 v1
Automotive embedded systems part7 v1Automotive embedded systems part7 v1
Automotive embedded systems part7 v1
 
Automotive embedded systems part6 v1
Automotive embedded systems part6 v1Automotive embedded systems part6 v1
Automotive embedded systems part6 v1
 
Automotive embedded systems part5 v1
Automotive embedded systems part5 v1Automotive embedded systems part5 v1
Automotive embedded systems part5 v1
 
Automotive embedded systems part4 v1
Automotive embedded systems part4 v1Automotive embedded systems part4 v1
Automotive embedded systems part4 v1
 
Automotive embedded systems part3 v1
Automotive embedded systems part3 v1Automotive embedded systems part3 v1
Automotive embedded systems part3 v1
 
Automotive embedded systems part2 v1
Automotive embedded systems part2 v1Automotive embedded systems part2 v1
Automotive embedded systems part2 v1
 
Automotive embedded systems part1 v1
Automotive embedded systems part1 v1Automotive embedded systems part1 v1
Automotive embedded systems part1 v1
 
Automotive embedded systems part8 v1
Automotive embedded systems part8 v1Automotive embedded systems part8 v1
Automotive embedded systems part8 v1
 
Quiz 10
Quiz 10Quiz 10
Quiz 10
 
Homework 6
Homework 6Homework 6
Homework 6
 
Homework 5 solution
Homework 5 solutionHomework 5 solution
Homework 5 solution
 
Notes part7
Notes part7Notes part7
Notes part7
 
Homework 5
Homework 5Homework 5
Homework 5
 
C programming session7
C programming  session7C programming  session7
C programming session7
 
Notes part6
Notes part6Notes part6
Notes part6
 
Homework 4 solution
Homework 4 solutionHomework 4 solution
Homework 4 solution
 

Recently uploaded

WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 

Recently uploaded (20)

WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 

First session quiz

  • 1. 1 | P a g e ENG. Keroles Shenouda https://www.facebook.com/groups/embedded.system.KS/ C PROGRAMMING FIRST SESSION QUIZ QUESTIONS 1) What is the compiler? 2) What is meant by native compiler and cross compiler? 3) What are the steps of compiling? Illustrate the steps as much as you can. 4) Explain briefly preprocessor? 5) What is meant by libraries? 6) Why using ‘C’ language specifically with embedded systems? 7) What will be the output of the following code: Include <stdio.h> Int main () { printf(“hello world”); return 0; }
  • 2. 2 | P a g e ENG. Keroles Shenouda https://www.facebook.com/groups/embedded.system.KS/ ANSWERS 1) Compiler is simply a translator that translates the ‘C’ language or any language to the targeted machine code. Example: c language compiled to work on Atmel AVR so that means ‘C’ translated to Atmel AVR assembly then converted to obj file and finally hex file that is flashed to the microctroller. Compiling a code is consisting of steps. 2) Native compiler: is the compiler that is compiling the current code to the current machine code to work “only” on the current machine and no other machine Cross compiler: means that this compiler will compile the code to work on another machine like in case of writing code to work on other microcontroller. 3) preprocessing The first stage of compilation is called preprocessing. In this stage, lines starting with a # character are interpreted by the preprocessor as preprocessor commands. These commands form a simple macro language with its own syntax and semantics. compilation The second stage of compilation is confusingly enough called compilation. In this stage, the preprocessed code is translated to assembly instructions specific to the target processor architecture. These form an intermediate human readable language. Assembly During the assembly stage, an assembler is used to translate the assembly instructions to machine code, or object code. The output consists of actual instructions to be run by the target processor. linking The object code generated in the assembly stage is composed of machine instructions that the processor understands but some pieces of the program are out of order or missing. To produce an executable program, the existing pieces have to be rearranged and the missing ones filled in. This process is called linking.
  • 3. 3 | P a g e ENG. Keroles Shenouda https://www.facebook.com/groups/embedded.system.KS/ The linker will arrange the pieces of object code so that functions in some pieces can successfully call functions in other pieces. It will also add pieces containing the instructions for library functions used by the program 4) preprocessing The first stage of compilation is called preprocessing. In this stage, lines starting with a # character are interpreted by the preprocessor as preprocessor commands. These commands form a simple macro language with its own syntax and semantics. 5) A library in C is a group of functions and declarations, exposed for use by other programs. The library therefore consists of an interface expressed in a .h file (named the "header") and an implementation expressed in a .c file. This .c file might be precompiled or otherwise inaccessible, or it might be available to the programmer. (Note: Libraries may call functions in other libraries such as the Standard C or math libraries to do various tasks.) 6) “C” language is powerful it has the ability to access memory directly using pointers Secondly is that “C” is portable and have many compilers that translates the “C” to other machines: microcontrollers assembly. 7) The code will not run as the “#” is missing from the code
  • 4. 4 | P a g e ENG. Keroles Shenouda https://www.facebook.com/groups/embedded.system.KS/