C Programming :: Variables & Data Types - Discussion
Home > C Programming > Variables & Data Types > MCQs Questions Discussion
28 / 51
What will be output of the following "c" code?
#include
#include
void main()
{
float f=5,g=10;
printf("%lf",f%g);
}
#include
void main()
{
float f=5,g=10;
printf("%lf",f%g);
}
A0
B1
C5
DCompilaiton Error: Cannot apply mod to float
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
STEP-BY-STEP
This particular code will produce an error, saying error: invalid operands to binary % (have 'float' and 'float').
The reason is that the Modulus operator(%), cannot be applied to float values.
Hence, correct option is D.
Read Full Answer
Report Error
Please Login First Click Here