-
What is the output of this program?
#include <iostream>
using namespace std;
int main ()
{
char First_ch, Second_ch, Third_ch;
cout << "Enter any word or number: ";
First_ch = cin.get();
cin.sync();
Second_ch = cin.get();
cin.sync();
Third_ch = cin.get();
cout << First_ch << endl;
cout << Second_ch << endl;
cout << Third_ch << endl;
return 0;
}
-
- Third
- Second
- First
- Returns first 3 letter or number from the entered word
- None of these
Correct Option: D
In this program, We are using the sync function to return the first three letters of the entered word.