What is the output of the program if characters ‘h’, ‘e’, ‘l’, ‘l’ , ‘o’ and enter are supplied as input?

What is the output of the program if characters ‘h’, ‘e’, ‘l’, ‘l’ , ‘o’ and enter are supplied as input?
#include #include using namespace std;
void f();
int main()
{
f(); return 0;
} void f() { char c; c = cin.get(); cout << c; if(c != 'n') f(); } A. It prints: hello
B. It prints: olleh
C. It prints: h
D. It prints: o

Download Printable PDF. VALID exam to help you PASS.

Posted in: CPA

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.