#include <iostream>
using namespace std;
int main()
{
string name, regNumber, college, address,mobileNumber; /* Have used string data type for all variables since student name and college name are strings,
Reg number may contain an alphabet,
Mobile number may contain + sign
and address may contain aname
*/
cout<<"\n Enter your name (e.g. Bonface): ";
getline(cin, name);
cout<<"\n Enter your mobile number (e.g +xxxx xxxx 777): ";
getline(cin, mobileNumber);
cout<<"\n Enter your Registration number (e.g. BIT/M/0002777/2020): ";
getline(cin, regNumber);
cout<<"\n Enter college name (e.g. Harvard): ";
getline(cin, college);
cout<<"\n Enter your address (e.g. xxxx, fake street, city): ";
getline(cin, address);
cout<<"\nHere is the details you entered \n";
cout<<"NAME"<<"\t\t"<<"MOBILE NUMBER"<<"\t\t"<<"REG NUMBER"<<"\t\t"<<"COLLEGE"<<"\t\t"<<"ADDRESS"<<"\n\n";
cout<<name<<"\t"<<mobileNumber<<"\t\t"<<regNumber<<"\t\t"<<college<<"\t\t"<<address<<"\t";
return 0;
}
Comments
Leave a comment