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

 #include<iostream>

using namespace std;

int main()

{

char name[25],city[30];

int age;

cout<<"Enter your age: ";

cin>>age;

cout<<"Enter your First name: ";

cin>>name;

cout<<"Enter your city: ";

cin>>city;

cout<<"\n Your First name is "<<name<<endl;

cout<<"\n Your city is "<<city<<endl;

cout<<"\n Your age is "<<age<<endl;

}

OUTPUT

Enter your age: 17

Enter your First name: MPT

Enter your city: RWP


 Your First name is MPT


 Your city is RWP


 Your age is 17


No comments:

Post a Comment