fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3. const float PI = 3.14;
  4.  
  5. int main(){
  6. int radius;
  7. char color[10];
  8. printf("Enter the circle radius > ");
  9. scanf("%d", &radius);
  10. printf("Enter the circle color > ");
  11. scanf("%s", color);
  12.  
  13. printf("The %s circle are = %.2f\n", color, PI*radius*radius);
  14.  
  15. /* The following works if the -ansi is omitted from compilation */
  16. printf("The %s circle are = %.2f\n", color, M_PI*radius*radius);
  17. return 0;
  18. }
Compilation error #stdin compilation error #stdout 0s 9432KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:16:47: error: ‘M_PI’ undeclared (first use in this function)
   printf("The %s circle are = %.2f\n", color, M_PI*radius*radius);
                                               ^~~~
prog.c:16:47: note: each undeclared identifier is reported only once for each function it appears in
stdout
Standard output is empty