Solution for Exercise 5-13

ex0513

#include <stdio.h>

int main()
{
	printf("%d/%d=%.1f\n",2,5,2.0/5.0);
    return(0);
}

Output

2/5=0.4

Notes

* The %.1f placeholder ensures that the number output shows only one digit after the decimal place.