C - Keywords - Discussion

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

 



Q.

What will be the output of following program ?

#include
int main( )
{
int i=2,j=3,k,l;
float a,b;
k = i/j * j;
l = j/i * j;
a = i/j * j;
b = j/i * i;
printf("%d %d%f%f\n",k,l,a,b);
return 0;
}

A. 3, 0, 0, 0 B. 0, 3, 0.000000, 2.000000
C. 0,0,0,0 D. Error

Answer: Option B
Explaination:

 


As K and L are integer variables so it prints the integer value as result and a and b are float variable, so float value will be print as result.








Discussion

Your Comments Goes here...
NameDiscussion