C Programming - Library Functions - Discussion

1. 

Point out the error in the following program.

#include<stdio.h>

int main()
{
    fprintf("IndiaBIX");
    printf("%.ef", 2.0);
    return 0;
}

[A]. Error: unknown value in printf() statement.
[B]. Error: in fprintf() statement.
[C]. No error and prints "IndiaBIX"
[D]. No error and prints "2.0"

Answer: Option B

Explanation:

Declaration Syntax:
int fprintf (FILE *stream, const char *format [, argument, ...]);

Example:
fprintf(filestream, "%s %d %s", Name, Age, City);


Ravi said: (Aug 19, 2011)  
Please explain this.

Payal said: (Oct 1, 2011)  
"%.ef" define what?

Bhakar said: (Feb 5, 2012)  
Value in e power.

Jayashri Vyavahre said: (Aug 16, 2013)  
What is the meaning of "%.ef" ?

Sowmiya said: (Jul 21, 2016)  
"%. ef" Can anyone explain this with an example?

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.