Skip to content

Beta · Data may be lost.Your data may be reset or lost.

GateBrew
← GATE CSE 2024 Set 1
Questions

Q9

MCQ1 mark, −0.33Programming

Consider the following C\mathrm{C} program:

#include <stdio.h>
void fX ();
int main(){
    fX();
    return 0 };
void fX () {
    char a;
    if ((a=getchar()) != '\n')
        fX();
    if (a != '\n')
        putchar (a); }

Assume that the input to the program from the command line is 12341234 followed by a newline character. Which one of the following statements is CORRECT?

Sign in to save attempts.

The solution is hidden while you attempt this question. It opens once you check or show the answer.