180k views
2 votes
Write a program that will ask the user to enter personal information and then will display it back to the user.

First, the program will ask the user to enter name. Then it will ask the user to enter address. Then it will ask the user to enter phone number. Then it will ask the user to enter email. At the end, it will display the user

User Ajitha
by
5.7k points

1 Answer

5 votes

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

// variables

string name,address,email;

int phone;

cout<<"enter your name:";

// read name

cin>>name;

cout<<"enter your address:";

// read address

cin>>address;

cout<<"enter your email:";

// read email

cin>>email;

cout<<"enter your phone number:";

// read phone number

cin>>phone;

// print all the details

cout<<"your name is "<<name<<endl;

cout<<"your address is "<<address<<endl;

cout<<"your phone number is "<<phone<<endl;

cout<<"your email is "<<email<<endl;

return 0;

}

Step-by-step explanation:

Read name from user and assign to variable "name",read address and assign to variable "address", read phone number and assign to variable "phone" and in last read email from user and assign it to variable "email".Then print all these details.

Output:

enter your name:sam

enter your address:nyc

enter your email:abc@xyz

enter your phone number:12312312

your name is sam

your address is nyc

your phone number is 12312312

your email is abc@xyz

User Adolf Garlic
by
6.0k points