
II-18 Programming Concepts
int main()
{
printf("Demo of return keyword");
return 0; /* '0' implies successful execution of program*/
}
16. What is the difference between %f and %g control strings? Whether both can be used for
representing float numbers?
Ans: The format string %f or %g is used to represent floating point number or real number in the form
of fraction, i.e., decimal notation. Precise results are obtained by %f. The precision indicates the number of
significant digits. In case precision is missing, i.e. for zero precision, fractional part appears with six digits.
With %g the real number or floating point number appears up to two decimal ...