Hi,
Can someone please explain why this prints out 0.000000? I'm new to C and not really understanding printing.
Code:#include <stdio.h> int main() { int number = 10; printf("%f", number); }
Hi,
Can someone please explain why this prints out 0.000000? I'm new to C and not really understanding printing.
Code:#include <stdio.h> int main() { int number = 10; printf("%f", number); }
%f is for printing floating point number; you passed it an integer, instead.
Tim S.
"...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson
Thanks.