A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

Discussion Forum

Que. What is the following code segment doing?
void fn( ){
char c;
cin.get(c);
if (c != ‘\n’) {
fn( );
cout.put(c);
}
}
a. The string entered is printed as it is.
b. The string entered is printed in reverse order.
c. It will go in an infinite loop.
d. It will print an empty line.
Answer:The string entered is printed in reverse order.
Priyanka :(July 15, 2020) How the string print in reverse order
Click to Add Comment

Confused About the Answer? Ask for Details Here
Know Explanation? Add it Here