edited by
589 views
2 votes
2 votes
#include<stdio.h>
#include<math.h>

int main(){
    int M_PI=25;
    printf("%d",M_PI);
    return 0;
}
  1. Run Time Error
  2. Compile Time Error
  3. 25
  4. Gargabe value
edited by

1 Answer

Best answer
1 votes
1 votes

Ans 2

It is a typical tricky question from C.

  • Constant M_PI is already defined in math.h to store value of pi.
  • In main () we are declaring a constant with same name M_PI

So compiler throws an error

  • If math.h is not included, the code will print 25
selected by

Related questions

0 votes
0 votes
1 answer
1
Don't you worry asked Jul 15, 2016
571 views
why the o/p of this programm is 12 ?#include<stdio.h>int main(){int x = 10;int y = (x++, ++x);printf("%d", y);getchar();return 0;}
0 votes
0 votes
1 answer
2
2 votes
2 votes
1 answer
4