Explain formatted I/O functions in detail.


This answer is not selected as best answer. This answer may not be sufficient for exam.

Your limit has been exceed. We have implemented this system because, We got difficulty on managing our servers. Please donate some amount to remove this limit.

Quota: 0 / 30


C provides standard functions scanf() and printf(), to perform formatted inputs and outputs. These functions accept a format specification string and a variable list as the parameters. The format specification string is a character string that specifies the data type of each variable to be input or output and the size or width of the I/O.

1. Scanf

The scanf() function is used for inputs formatted from standard inputs and provides numerous conversion options for the printf() function.

scanf(format_specifiers, &data1, &data2,……);


scanf("%d %c", &data1, &data2);

2. printf

The printf() function is used for output formatted as the standard output according to a format specification. The format specification string and the output data are the parameters of the printf() function.


printf(format_specifiers, data1, data2,…..... );


printf("%d %c", data1, data2);

Here is a example program

#include <stdio.h> 

void main(){
    int a;
    printf("Enter a value:"); 
    printf("Entered Value= %d",a);
If you found any type of error on the answer then please mention on the comment or submit your new answer.
Leave your Answer:

Click here to submit your answer.

  Loading . . .