fork download
  1. #include <stdio.h>
  2.  
  3. #define PI = 3.141592;
  4.  
  5. int main(void) {
  6.  
  7. int a;
  8. int area, peri;
  9.  
  10.  
  11. area = PI * a*a;
  12. peri = PI *2 *a;
  13. printf("Enter the radius:\n ");
  14. scanf("%d", &a);
  15.  
  16. printf("Area = %d\n", area);
  17. printf("Peri= %d\n", peri);
  18.  
  19.  
  20.  
  21. }
  22.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
5.0
compilation info
prog.c: In function 'main':
prog.c:3:12: error: expected expression before '=' token
 #define PI = 3.141592;
            ^
prog.c:11:9: note: in expansion of macro 'PI'
  area = PI * a*a;
         ^
prog.c:11:12: error: invalid type argument of unary '*' (have 'int')
  area = PI * a*a;
            ^
prog.c:3:12: error: expected expression before '=' token
 #define PI = 3.141592;
            ^
prog.c:12:9: note: in expansion of macro 'PI'
  peri = PI *2 *a;
         ^
prog.c:12:12: error: invalid type argument of unary '*' (have 'int')
  peri = PI *2 *a;
            ^
stdout
Standard output is empty