C - Keywords - Discussion

You Are Here :: Home > C > Keywords - Discussion

 



Q.

What will be the output of following program ?

#include
int main( )
{
float a=5,b=2;
int c,d;
c =a%d;
d =a/2;
printf("%d\n",d);
return 0;
}

A. 3 B. 2
C. Error D. None of above

Answer: Option C
Explaination:

 


Program will give the error : Illegal use of floating point. The statement c = a%b will give the error








Discussion

Your Comments Goes here...
NameDiscussion