C++ Program For get vs getline
Master C++ with Real-time Projects and Kickstart Your Career Start Now!!
Program 1
// get and getline method
#include<iostream>
#include<fstream>
#define clrscr() system("cls")
using namespace std;
int main()
{
char name[20];
char college[20];
clrscr();
cout<<"\nEnter your Name:";
cin.getline(name,20);
cout<<"\nEnter your College Name:";
cin.getline(college,20);
cout<<"\nName: "<<name;
cout<<"\nCollege: "<<college;
return 0;
}
Your 15 seconds will encourage us to work even harder
Please share your happy experience on Google

