-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbusdriberproblem.c
70 lines (62 loc) · 1.91 KB
/
busdriberproblem.c
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
/*
-------------------------------------------------------
Name : Bus Driver
Author : Kushal Singh Rathore
Discription : Bus Driver Details With Help Of Struct
-------------------------------------------------------
*/
#include<stdio.h>
struct driver
{
char name[50];
char dlnum[50];
char route[50];
int kms;
};
int main()
{
struct driver d1,d2,d3;
printf("enter the details of driver 1\n");
printf("please enter the name of driver\n");
scanf("%s",&d1.name);
printf("please enter the dlnum\n");
scanf("%s",&d1.dlnum);
printf("please enter the route\n");
scanf("%s",&d1.route);
printf("please enter kms\n");
scanf("%d",d1.kms);
printf("enter the details of driver 2\n");
printf("please enter the name of driver\n");
scanf("%s",&d2.name);
printf("please enter the dlnum\n");
scanf("%s",&d2.dlnum);
printf("please enter the route\n");
scanf("%s",&d2.route);
printf("please enter kms\n");
scanf("%d",d2.kms);
printf("enter the details of driver 3\n");
printf("please enter the name of driver\n");
scanf("%s",&d3.name);
printf("please enter the dlnum\n");
scanf("%s",&d3.dlnum);
printf("please enter the route\n");
scanf("%s",&d3.route);
printf("please enter kms\n");
scanf("%d",d3.kms);
printf("-------details of drivers--------\n");
printf("*********details of driver 1***********\n");
printf("name=%s\n",d1.name);
printf("dlnum=%s\n",d1.dlnum);
printf("route=%s\n",d1.route);
printf("kms=%d\n",d1.kms);
printf("*********details of driver 2***********\n");
printf("name=%s\n",d2.name);
printf("dlnum=%s\n",d2.dlnum);
printf("route=%s\n",d2.route);
printf("kms=%d\n",d2.kms);
printf("*********details of driver 3***********\n");
printf("name=%s\n",d3.name);
printf("dlnum=%s\n",d3.dlnum);
printf("route=%s\n",d3.route);
printf("kms=%d\n",d3.kms);
}