Computer Science, asked by vaibhav505351, 6 months ago

What is the output of the C Program?
int maino
{
float a=10.0
a = (int)a % 3:
printf("%f", a).
return 0;
}
a) o
b) 1
c) 1000000
d) Compiler Error​

Answers

Answered by durgeshbishi2
0

Answer: 1.000000.

Explanation: As according to the question, we have to find the output of the following C Program,

int maino

{

float a=10.0

a = (int)a % 3:

printf("%f", a).

return 0;

}

So Typecasting from float to int is done by(int).

(int)10.000000=10;

10%3=1.

As a reminder of the division of 10 by 3.

So, %f in printf prints as 1.000000

Hence, the output is 1.000000

#SPJ3

Similar questions