Page 1 of 1

What will be the output of the following C code if the input given to the code shown below is “sanfoundry”?

Posted: Wed Jul 13, 2022 7:56 pm
by answerhappygod
#include<stdio.h>
#define NL '\n'
main()
{
void f(void);
printf("enter the word\n");
f();
}
void f(void)
{
char c;
if((c=getchar())!=NL)
{
f();
printf("%c",c);
}
return;
}
a) sanfoundry
b) infinite loop
c) yrdnuofnas
d) fnasyrdnuo