Warning: implode(): Invalid arguments passed in /www/wwwroot/jobquiz.info/mdiscuss.php on line 336 What will be the output of the program? #include<stdio.h> int main() { float f=43.20; printf("%e, ", f); printf("%f, ", f); printf("%g", f); return 0; } ?->(Show Answer!)
1. What will be the output of the program? #include<stdio.h> int main() { float f=43.20; printf("%e, ", f); printf("%f, ", f); printf("%g", f); return 0; }
Ask Your Doubts Here
Comments
By: guest on 01 Jun 2017 06.01 pm
printf("%e, ", f); Here '%e' specifies the "Scientific Notation" format. So, it prints the 43.20 as 4.320000e+01. printf("%f, ", f); Here '%f' specifies the "Decimal Floating Point" format. So, it prints the 43.20 as 43.200001. printf("%g, ", f); Here '%g' "Use the shorter of %e or %f". So, it prints the 43.20 as 43.2.