-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEx2.c
45 lines (34 loc) · 1 KB
/
Ex2.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
// maths and science - 45
// science - 15
// maths - 15
// print the type of gift you are giving to them
#include <stdio.h>
int main(int argc, char const *argv[])
{
/* code */
int gift;
// print function starts from here
printf("Enter the number of gifts: \n");
// scan function starts from here
scanf("%d", &gift);
// print function again
printf("You have distributed the %d number of gifts\n", gift);
// looping statement starts from here
if (gift >= 45)
{
printf("You have distributed the %d number of smartphones to both maths and science students");
}
else if (gift >= 15)
{
printf("You have distributed the %d number of laptop to science students");
}
else if (gift >= 15)
{
printf("You have distributed the %d number of smartwatches to maths students");
}
else
{
printf("The amount of gifts you have distributed is insufficient.");
}
return 0;
}