Saturday, 25 February 2017

GATE EXAM PREPARATION IN "C" - Input and Output

#include "stdio.h"
int main()
{
    char arr[100];
    printf("%d", scanf("%s", arr));
    /* Suppose that input value given
        for above scanf is "GeeksQuiz" */
    return 1;
}

(A) 9
(B) 1
(C) 10
(D) 100


Answer: (B) 

Explanation: In C, scanf returns the no. of inputs it has successfully

No comments:

Post a Comment