Data Structures :: Strings - Discussion
Home > Data Structures > Strings > MCQs Questions Discussion
73 / 2
What is the following code segment doing?
void fn( ){
char c;
cin.get(c);
if (c != '\n') {
fn( );
cout.put(c);
}
}
void fn( ){
char c;
cin.get(c);
if (c != '\n') {
fn( );
cout.put(c);
}
}
AThe string entered is printed as it is
BThe string entered is printed in reverse order.
CIt will go in an infinite loop.
DIt will print an empty line.
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
No Discussion on this question yet!