Sunday, 12 June 2016

C++ structure program of person

In this program we will create structure of person enter data in structure and also show the entered data.
The code is given below.

//Code Starts

#include<iostream>
#include<conio.h>

using namespace std;

struct person
{
char name[15];
char age[2];
char father_name[20];
char adress[40];
char phone[11];
};

int main()
{
person p;
cout<<"Enter Name "<<endl;
cin>>p.name;
cout<<"Enter Father's Name "<<endl;
cin>>p.father_name;
cout<<"Enter Age "<<endl;
cin>>p.age;
cout<<"Enter Adress "<<endl;
cin>>p.adress;
cout<<"Enter Mobile Number "<<endl;
cin>>p.phone;
cout<<"Your Entered Data :"<<endl;
cout<<p.name<<endl;
cout<<p.age<<endl;
cout<<p.father_name<<endl;
cout<<p.adress<<endl;
cout<<p.phone<<endl;
getch();
}
//Code Ends

OUTPUT:





Share:

0 comments:

Post a Comment