C Programming MCQ

1:

The following statement
           prlntf( ‘%f ’, 9/5) ;
prints

A.

1.8

B.

1.0

C.

2.0

D.

0.00

 

Answer : D

Explanation :

This statement is undefined behavior because the argument has to be of type double and 9 / 5 is of type int.

Following program yields an output of 1.8

int main()
{
    printf("%f",9/5.0);
 return 0;
}

Write your comments here:


Report Error
 

Option: A

Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here.