0% found this document useful (0 votes)
24 views6 pages

Hospital Management System - Io

Uploaded by

arun prabu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views6 pages

Hospital Management System - Io

Uploaded by

arun prabu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

HOSPITAL MANAGEMENT SYSTEM

PROGRAM
#include <stdio.h>

#include <stdlib.h>

#include <string.h>

int main() {

int patient_id, doctor_fee, room_charge, lab_charge, medicine_charge, total;

char patient_name[100], patient_medical_history[500];

int appointment_id, appointment_patient_id, appointment_doctor_id;

char appointment_date[20], appointment_time[10];

// Add Patient

printf("Enter patient ID: ");

scanf("%d", &patient_id);

printf("Enter patient name: ");

scanf("%s", patient_name);

printf("Enter medical history: ");

scanf("%s", patient_medical_history);

// Display Patients

printf("\nPatients:\n");

printf("ID: %d, Name: %s, Medical History: %s\n", patient_id, patient_name, patient_medical_history);

// Schedule Appointment

printf("Enter appointment ID: \n");

scanf("%d", &appointment_id);

printf("Enter patient ID:\n ");

scanf("%d", &appointment_patient_id);

printf("Enter doctor ID: \n");

scanf("%d", &appointment_doctor_id);
printf("Enter date: \n");

scanf("%s", appointment_date);

printf("Enter time: \n");

scanf("%s", appointment_time);

// Display Appointments

printf("\nAppointments:\n");

printf("ID: %d, Patient ID: %d, Doctor ID: %d, Date: %s, Time: %s\n", appointment_id, appointment_patient_id,
appointment_doctor_id, appointment_date, appointment_time);

// Generate Bill

printf("Enter patient ID: ");

scanf("%d", &patient_id);

printf("Enter doctor's fee: ");

scanf("%d", &doctor_fee);

printf("Enter room charge: ");

scanf("%d", &room_charge);

printf("Enter lab charges: ");

scanf("%d", &lab_charge);

printf("Enter medicine charges: ");

scanf("%d", &medicine_charge);

total = doctor_fee + room_charge + lab_charge + medicine_charge;

printf("Generating bill...\n");

printf("Patient ID: %d\n", patient_id);

printf("Doctor's Fee: %d\n", doctor_fee);

printf("Room Charge: %d\n", room_charge);

printf("Lab Charges: %d\n", lab_charge);

printf("Medicine Charges: %d\n", medicine_charge);

printf("Total Bill: %d\n", total);

return 0;

}
OUTPUT

Enter patient ID: 1

Enter patient name: arun

Enter medical history: split_personality

Patients:

ID: 1, Name: arun, Medical History: split_personality

Enter appointment ID:

Enter patient ID:

Enter doctor ID:

23

Enter date:

2.3.25

Enter time:

12:32

Appointments:

ID: 1, Patient ID: 2, Doctor ID: 23, Date: 2.3.25, Time: 12:32

Enter patient ID: 1

Enter doctor's fee: 50000

Enter room charge: 3434

Enter lab charges: 3233

Enter medicine charges: 43443

Generating bill...

Patient ID: 1

Doctor's Fee: 50000

Room Charge: 3434

Lab Charges: 3233

Medicine Charges: 43443

Total Bill: 100110


=== Code Execution Successful ===

ALGORITHM
1. Add Patient:

 Input patient ID, name, and medical history.

2. Display Patient:

 Print patient details.

3. Schedule Appointment:

 Input appointment ID, patient ID, doctor ID, date, and time.

4. Display Appointment:

 Print appointment details.

5. Generate Bill:

 Input billing details.

 Calculate total.

 Print bill.

6. End Program

PSEDOCODE
1. Add Patient:

- Print "Enter patient ID:"

- Read patient_id

- Print "Enter patient name:"

- Read patient_name

- Print "Enter medical history:"

- Read patient_medical_history

2. Display Patient:

- Print "\nPatients:\n"
- Print "ID: patient_id, Name: patient_name, Medical History: patient_medical_history"

3. Schedule Appointment:

- Print "Enter appointment ID:"

- Read appointment_id

- Print "Enter patient ID:"

- Read appointment_patient_id

- Print "Enter doctor ID:"

- Read appointment_doctor_id

- Print "Enter date:"

- Read appointment_date

- Print "Enter time:"

- Read appointment_time

4. Display Appointment:

- Print "\nAppointments:\n"

- Print "ID: appointment_id, Patient ID: appointment_patient_id, Doctor ID: appointment_doctor_id, Date:
appointment_date, Time: appointment_time"

5. Generate Bill:

- Print "Enter patient ID:"

- Read patient_id

- Print "Enter doctor's fee:"

- Read doctor_fee

- Print "Enter room charge:"

- Read room_charge

- Print "Enter lab charges:"

- Read lab_charge

- Print "Enter medicine charges:"

- Read medicine_charge

- Calculate total = doctor_fee + room_charge + lab_charge + medicine_charge

- Print "Generating bill..."

- Print "Patient ID: patient_id"

- Print "Doctor's Fee: doctor_fee"


- Print "Room Charge: room_charge"

- Print "Lab Charges: lab_charge"

- Print "Medicine Charges: medicine_charge"

- Print "Total Bill: total"

6. End Program:

- Print "Program Ended"

You might also like