#include <stdio.h>
int main()
{
double a=3.151, b=3.249;
double x=3.15, y=3.25;
printf("3.151 printed with 1d becomes => %.1f\n",a);
printf("3.249 printed with 1d becomes => %.1f\n",b);
/* Rounds when not exactly half way: 3.151=>3.2 and 3.249=>3.2 */
printf("3.15 printed with 1d becomes => %.1f\n",x);
printf("3.25 printed with 1d becomes => %.1f\n",y);
/* Truncates when exactly half way: 3.15=>3.1 and 3.25=>3.2 */
return 0;
}