Input / Output

Q1:
What will be the output of the program if value 25 given to scanf()?
#include<stdio.h>

int main()
{
    int i;
    printf('%d\n', scanf('%d', &i));
    return 0;
}

A 25

B 2

C 1

D 5

ANS:A - 25

The scanf function returns the number of input is given. printf('%d\n', scanf('%d', &i)); The scanf function returns the value 1(one). Therefore, the output of the program is '1'.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.