What will be the output of the following C code?
char str[20];
str= "123546"; res= atof(str);
printf("String value = %s, Float value = %f\n", str, res);
char str[20];
str= "123546"; res= atof(str);
printf("String value = %s, Float value = %f\n", str, res);A. String value = 123546, Float value = 123546.0
B. String value = 123546 , Float value = 123546.000000
C. String value = 123546 , Float value = 0.000000
D. String value = 123546 , Float value = 123546.000
Answer: Option B

Join The Discussion