Programmes written in high level languages need to be converted into machine languages before the computer can execute them.Interpreters and compilers are translation or converting programmes that produce the machine code from high level languages. The original program is called source code.An after it is translated by the interpreter or the compiler,it is called an object programme
Calculate percentage #include < stdio.h > void main() { int s1, s2, s3, s4, s5, sum, total = 500; float per; printf("\nEnter marks of 5 subjects : "); scanf("%d %d %d %d %d", &s1, &s2, &s3, &s4, &s5); sum = s1 + s2 + s3 + s4 + s5; printf("\nSum : %d", sum); per = (sum * 100)/500; /* percentage formula*/ printf("\nPercentage : %f", per); }
Comments
Post a Comment