A compiler on the other hand,Takes an entire high level programme and produce a machine code version out of it.This version is then run as a single programme
The object code can be stored in the computers memory for executing in future.A compiler doesn't need to translate the source programme every time it need to the executed their by saving execution time
Example: C compiler,C++ compiler
Greatest of 3 numbers #include < stdio.h > void main() { int a,b,c; printf("enter any three numbers:\n"); scanf("%d%d%d",&a, &b, &c); if(a>b&&a>c) /*if a is greater than b & c*/ printf("greatest number is: %d",a); else if(b>c) /*if not a then if b is greater than c*/ printf("greatest number is: %d",b); else /*if a & b are not greater*/ printf("greatest number is: %d",c); }
Comments
Post a Comment