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
Simple interest #include < stdio.h > void main() { int amount, rate, time, ans; printf("\nEnter Principal Amount : "); scanf("%d", &amount); printf("\nEnter Rate of Interest : "); scanf("%d", &rate); printf("\nEnter Period of Time : "); scanf("%d", &time); ans = (amount * rate * time)/100; /*Simple interest formula*/ printf("\nSimple Interest : %d",ans); }
Comments
Post a Comment