C++ program to read and display an entire line entered by user
#include <iostream>
using namespace std;
int main()
{
char str[100];
cout << "Enter a string: ";
cin.get(str, 100);
cout << "You entered: " << str << endl;
return 0;
}
Output
Enter a string: Programming is fun. You entered: Programming is fun.
No comments:
Post a Comment
Thanks For Reading! Visit Again