Prof.C.Naga Raju Department of CSE YSR Engineering College of YVU Proddatur
Prof.C.Naga Raju Department of CSE YSR Engineering College of YVU Proddatur
Prof.C.Naga Raju Department of CSE YSR Engineering College of YVU Proddatur
Naga Raju
B.Tech(CSE),M.Tech(CSE),PhD(CSE),MIEEE,MCSI,MISTE
Department of CSE
YSR Engineering College of YVU
Proddatur
6/11/2020 1
Contents
1) Motivation with c programs
2) Introduction to compilers
3) Types of compilers
4) Phases of compilers
5) Previous GATE ,DL and Bank officers questions
#include<stdio.h> #include<stdio.h>
#define x (4+1) #define x 4+1
int main() { int main() {
int i=5; int i=5;
i = x*x*x; i = x*x*x;
printf("%d",i); printf("%d",i);
return 0; return 0;
} }
(a) 125 (b) 13 (c) 17 (d) None of (a) 125 (b) 13 (c) 17 (d) None of above
above
'int' 'main' '(' ')' '{' 'int' 'a' ',' 'b' ';' 'a' '=' '10' ';' 'return' '0' ';' '}‘
It Remove comments and white spaces
It Interacts with the symbol table
sends lexical errors to error handling table
a Int 1000
b Int 1002
c Float 1004
z char 1008
Codes: A B C D
(a) 2 3 1 4 (b) 2 1 4 3 (c) 2 4 1 3 (d) 2 3 4 1
OPTION C
6/11/2020 Prof. C.NagaRaju 9949218570 37
9) In a two-pass assembler, symbol table is
A) 12
B) 11
C) 10
D) 07