Create a c++ program that would ask the user to enter their personal information : Lastname, First name, Middle Name, Birthday, Age, Gender and Permanent address. The program must display all the information input by the user.
#include <iostream>
#include <string>
using namespace std;
int main() {
string last, first, middle;
int age;
string birthday;
string gender;
string address;
cout << "Enter you lastname: ";
cin >> last;
cout << "Enter you firstname: ";
cin >> first;
cout << "Enter you middlename: ";
cin >> middle;
cout << "Enter your birthday: ";
cin >> ws;
getline(cin, birthday);
cout << "Enter your age: ";
cin >> age;
cout << "Enter your gender: ";
cin >> gender;
cout << "Enter your permanent address: ";
cin >> ws;
getline(cin, address);
cout << "Hello " << first << " " << middle << " " << last << endl;
cout << "Your birthday is " << birthday
<< " and now you are " << age << " years old." << endl;
cout << "You are " << gender << endl;
cout << "and you live at " << address << endl;
return 0;
}
Comments
Leave a comment