Develop a program in c++ to read and write the following information using a structured data type,Name of the patient,gender,age,and nature of illness.


#include<iostream>
#include<conio.h>
#include<stdio.h>
using namespace std;

struct
{

    char name[30];
    char gender;
    int age;
    char noi[50];
}p;
int main()
{

cout<<"Enter Patient Name = ";
cin>>p.name;
cout<<"Enter patient gender = ";
cin>>p.gender;
cout<<"Enter your age=";
cin>>p.age;
cout<<"Enter Patient nature of illness=";
cin>>p.noi;
cout<<"\nPatient Name="<<p.name;
cout<<"\nPatient's gender="<<p.gender;
cout<<"\nPatient Age = "<<p.age;
cout<<"\nPatient Nature of illness="<<p.noi;
getch();
return 0;
}


0 Comments