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 : B Explanation : |
|
Option: A Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. |