What will be the output of this C program? #include<stdio.h> int main() { float p=10.5; int a=5*p+5.0; printf("%d\n", a); return 0; }
- A.57.500000
- B.57
- C.57.000000
- D.The program has errors and will not run.
Show answer
Answer: B. 57
5 * 10.5 + 5.0 = 57.5, which is truncated to 57 when assigned to integer 'a'.