Hi. I'm new here. Anyway, I have an assignment of writing programs from outputs provided.
Here's an output given in the assignment that I think is wrongly done. I'm saying this because I tried many, many times just to get the exact output, but only to no avail.
So, I just wanna make sure.
Here's the output given:
Output: 24 roses cost 19.95 per 12
And here's my answer:
#include <stdio.h>
main()
{
printf("%d roses cost %2f per %d\n", 24, 19.95, 12);
return 0;
}
But now, the problem here is that when I write this program, I do not get exactly 19.95 for the output. But instead, I got a 19.950000....so, WTH??? How did the -0000 came from???
So, now I'm in a complete mess. Please help me out here. I'm a noob too. So please be genteel. lols.Thanks in advance.
p/s: I'm hoping for a reply thread ASAP.