what is the difference between compiler and interpreter

what is the difference between compiler and interpreter

what is the difference between compiler and interpreter

compiler interpreter
1) it read the program once and then translate into machine code 1) it read the program line by line and translate it into machine code.
2) execution of compiler is faster than interpreter 2) execution of interpreter is slower than compiler.
3) compiler is complex than interpreter 3) it is not complex as compiler
4) C lang.uses compiler 4) PASCAL uses interpreter

what is the difference between compiler and interpreter

 

 

difference between entry controlled loop and exit controlled loop

 

Entry controlled loop Exit controlled loop
1) in this kind of loop the condition is check first and if the condition is true then body of loop is executed 1) in this kind of loop the condition is check last, so atleast one time body of loop is executed even if the condition is false.
2) while and for loop are this kind of loops 2) do loop is this kind of loop.
3)example :

a=1;

While(a>5)

{

Printf(“%d”,a);

}

 

Output : 1

3) example :

a=1;

Do

{

Printf(“%d”,a);

}

While(a>5);

 

Output : 1

 

difference between break and continue statements

 

Break statement Continue statement
1) when break statement is found in any loop then execution of loop is terminated and control is transferred to next line after body of loop 1) when continue statement is found in any loop then again condition is checked without execution the next statements in loop.
2) example:

For(i=1;i<=5;i++)

{

Printf(“%d”,i);

If(i==2)

Break;

}

Output : 1 2

2) example :

For(i=1;i<=5;i++)

{

Printf(“%d”,i);

If(i==2)

continue;

}

Output : 1 2 3 4 5

 

click here to read more c programming article

Adarsh Patel

My Self Adarsh Suryakant Patel. Currently I am working as Assistant Professor at Parul Instiute of Engineering and Technology, MCA Department, Limda, Vadodara. Major Responsibility : * Lectures * Organizing Training and Expert Sessions for * Placement and Recruitment * Faculty Representative