-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathRailway ticket maintainance system
72 lines (65 loc) · 1.54 KB
/
Railway ticket maintainance system
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include<stdio.h>
#include<stdlib.h>
int main()
{
int class1;
int b;
int a;
int input;
char ch;
printf(“\n\t\t\t————–Welcome to the Ranchi Railway station————-\n”);
printf(“\nPress 1 for First Class Seat Reservation!”);
printf(“\n\nPress 2 for Economy Class Seat Reservation!\n “);
scanf(“%d”, &class1);
switch(class1)
{
case 1:
{
printf(“\n Enter your seat Number in First class:-“);
scanf(“%d”,&a);
if (a < 100)
{
printf(“\n\t\t\t\t\t\t\t\t————–Your Ticketing Details—————-\n”);
printf(“Your Class: First Class”,class1);
printf(“\nYour Seat Number:- %d \n\n“, a);
}
else
{
printf(“\n seats full do you wanna resreved in Economy?:-“);
scanf(” %c“,&ch);
if(ch ==’y’||ch == ‘Y’)
{
printf(“\nYour ticket has been booked in Economy Class”);
printf(“\nYour Seat Number:- %d \n\n”,a);
}
break;
}
case 2:
{
printf(“\n Enter your seat Number in Economy class:”);
scanf(“%d“,&b);
if (b >= 101 || b < 200)
{
printf(“\n\t\t\t\t\t\t\t\t————–Your Ticketing Details—————-\n“);
printf(“Your Class: economy Class”,class1);
printf(“\nYour Seat Number:- %d“, b);
}
else
{
printf(“\n Sorry seats full do you wanna resreved in First class(Y or N) ?:-“);
scanf(“ %c“,&ch);
if(ch ==’y’||ch==’y’)
{
printf(“\nYour ticket has been booked in Economy Class”);
printf(“\nYour Seat Number:- %d“,a);
}
break;
default:
printf(“\n Sorry There is an Error ! Please choose given Option \n\n\t\t\t Thank You “);
break;
}
}
return 0;
}
}
}