jituTechnology

jituTechnology

>Write a Program using structure to create a database for a hospital giving details about the patient admitted.

>/*Write a Program using structure to create a database for a hospital giving details about the patient admitted.

Programmed By:
Name: Jitendra Kr Yadav
Roll: 10116(NCIT-ELX)
Date: 15 July 2011 */
#include <iostream.h>
#include <conio.h>
struct patient
{
char name[30];
int age;
intbn;
charnoi[30];
char gender[30];
intwn;
struct dob
{
int day;
int month;
int year;
}db;
structdoa
{
int day;
int month;
int year;
}da;
}p;
int main()
{
cout<<“Enter the patient name: “;
cin>>p.name;
cout<<“Enter the Age of patient: “;
cin>>p.age;
cout<<“Enter the bed number of patient: “;
cin>>p.bn;
cout<<“Enter the nature of illness: “;
cin>>p.noi;
cout<<“Enter the day of birth of patient: “;
cin>>p.db.day;
cout<<“Enter the month of birth of patient: “;
cin>>p.db.month;
cout<<“Enter the year of birth of patient: “;
cin>>p.db.year;
cout<<“Enter the gender of patient: “;
cin>>p.gender;
cout<<“Enter the ward number of patient: “;
cin>>p.wn;
cout<<“Enter the date of admission of patient in dd mm yy: “;
cin>>p.da.day>>p.da.month>>p.da.year;
cout<<“Patient Name: “<<p.name<<endl<<“Age: “<<p.age<<endl<<“Bed No.”<<p.bn<<endl<<“Nature of illness: “<<p.noi<<endl<<“Date of birth: “<<p.db.day<<” “<<p.db.month<<” “<<p.db.year<<endl<<“Gender: “<<p.gender<<endl<<“Ward No: “<<p.wn<<endl<<“Date of admission: “<<p.da.day<<” “<<p.da.month<<” “<<p.da.year;
getch();
return 0;
}
Output Sample:
Enter the patient name: Erick
Enter the age of patient: 19
Enter the bed number of patient: 201
Enter the nature of illness: Viral
Enter the day of birth of patient: 10
Enter the month of birth of patient: 12
Enter the Year of birth of patient: 1991
Enter the gender of patient: Male
Enter the ward number of patient: 1012
Enter the Date of admission of patient in mm ddyyyy: 14
07
2011
Patient Name: Erick
Age: 19
Bed No: 201
Nature of illness: Viral
Date of birth: 10 12 1991
Gender: Male
Ward No: 1012
Date of admission 14  7 2011
Add a comment

Comments (1)

  1. Sandeep hakalJuly 15, 2011 Reply
    >Thanks dude!!

Add a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.



Connect with Me

GPO 8973 NPC 541; Kathmandu Nepal
Phone: +977 9851236800

Calendar

October 2019
S M T W T F S
« Jun    
 12345
6789101112
13141516171819
20212223242526
2728293031