0% found this document useful (0 votes)
26 views2 pages

Project

Uploaded by

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

Project

Uploaded by

Ayush Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

#include <stdio.

h>

struct Train
{
char train_name[100];
int train_number;
char departure_station[50];
char arrival_station[50];
int total_seats;
int booked_seats;
};

struct Passenger
{
char name[50];
int passenger_id;
int booked_train_number;
int seat_number;
};

int new_train (struct Train *tr) {


printf("Enter train name:");
scanf("%s", tr->train_name);
printf("Enter train number:");
scanf("%d", &tr->train_number);
printf("Enter departure station:");
scanf("%s", tr->departure_station);
printf("Enter arrival station:");
scanf("%s", tr->arrival_station);
printf("Enter total seats:");
scanf("%d", &tr->total_seats);

printf("\nTrain added Successfully!");


return 0;
}

int main() {
int choice;

printf("Railway Managment System\n");


printf ("[Link] New Train\n");
printf ("[Link] New Passenger\n");
printf ("[Link] a Ticket\n");
printf ("[Link] a Ticket\n");
printf ("[Link] for Trains\n");
printf ("[Link] Train Schedule\n");
printf ("[Link] Data to File\n");
printf ("[Link] Data from File\n");
printf ("[Link] Booking Statistics\n");
printf ("[Link]\n");
scanf ("%d", &choice);

int i = 0;
struct Train trains[100];

switch (choice) {
case 1:
if (i<100) {
new_train (&trains[i]);
i++;
}
else
printf("Trains limit exceeded,cannot add more train");

break;

case 2:

break;

case 3:

break;

case 4:

break;

case 5:

break;

case 6:

break;

case 7:

break;

case 8:

break;

case 9:

break;

case 10:

break;

default:
printf("Invalid choice. Please try again.\n");

return 0;
}

You might also like