-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain File
85 lines (70 loc) · 1.07 KB
/
Main File
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
73
74
75
76
77
78
79
80
81
82
83
84
85
#include <stdio.h>
int n;
void start();
struct data
{
char name[100];
int quant;
};
void option1()
{
struct data obj[10];
for(int i=0;i<10;i++)
{
}
}
void option2()
{
struct data obj[10];
char item[200];
int quantity;
printf("Enter name of the item: ");
scanf("%s",item);
printf("Quantity you would like to buy: ");
scanf("%d",&quantity);
}
void option3()
{
printf("Function3");
}
void option4()
{
printf("Function4");
}
void start1(int n)
{
switch (n)
{
case 1: {
option1();
break; }
case 2: {
option2();
break; }
case 3: {
option3();
break; }
case 4: {
option4();
break;
}
default: {
printf("\nYou have entered an invalid input please try again");
start(); }
}
}
void start()
{
printf("What do you want to do?\n");
printf("To see all the available items enter 1\n");
printf("To buy something enter 2\n");
printf("To see your cart enter 3\n");
printf("To exit enter 4\n");
scanf("%d", &n);
start1(n);
}
int main()
{
printf(" Hello to the Store\n");
start();
}