Program that inputs name, age and address from the user and then displays.

Topic:

Standard Input in C++

Problem:

Write a program that inputs name, age and address from the user and then displays.

Solution:

#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
int main ()
{
char name[10], address[20];
int age;
cout<<"enter your name:";
cin>>name;
cout<<endl<<"enter your age:";
cin>>age;
cout<<endl<<"enter your address:";
cin>>address;
cout<<endl<<"your age is:"<<age<<endl;
cout<<endl<<"your name is:"<<name<<endl;
cout<<endl<<"your address is:"<<address<<endl;
getch();
}

Output:





Let me know in the comment section if you have any question.

Previous Post:

Next Post: