A

Admin • 833K Points
Coach

Q. What is the output of this code?

Code:
#include <stdio.h>
#define PI 3.14
int main() {
printf("%.2f", PI);
return 0;
}
  • (A) 3.14
  • (B) 3.00
  • (C) PI
  • (D) Error
  • Correct Answer - Option(A)
  • Views: 19
  • Filed under category C Programming
  • Hashtags:

Explanation by: Admin

#define replaces PI with 3.14 before compilation.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.