0
why output is not 3.000000?
#include <stdio.h> int main() { printf("The Value is %f\n", 3); return 0; }
2 Answers
+ 2
The data (3) is an integer literal (no decimal point), use a floating point literal e.g. 3.0 instead.
Type mismatch between the format specifier and the data to be printed causes unpredictable behaviour.
+ 1
Write this code instead.
printf("The Value is %f\n", (double)3);