A Fraction of an Int

Test your C programming skills by solving the given puzzle about number division.

We'll cover the following...

Puzzle code

Read carefully the code given below:

C
#include <stdio.h>
int main()
{
int a, b;
a = 5; b = 4;
printf("%d/%d = %f\n", a, b, a/b);
return(0);
}

Your task: Guess the output

Attempt the following test to assess your understanding.

1.

What is the expected output of the above code?

A.

5/4 = 0.00

B.

5/4 = 1.25

C.

5/4 = 0.125

D.

5/4 = 0.000000


1 / 1

Let's discuss the code and output together in the next lesson.