-
Notifications
You must be signed in to change notification settings - Fork 0
/
conditional.c
89 lines (68 loc) · 1.2 KB
/
conditional.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#include <stdio.h>
void is_evenly_divisible(int a, int b)
{
if(b!=0)
{
if(a%b == 0)
{
printf("EVENLY DIVISIBLE\n");
}
else
{
printf("NOT EVENLY DIVISBLE\n");
}
}
else
{
printf("UNDEFINED\n");
}
return;
}
/*MEDIAN_INT FUNCTION*/
void median_int(int a, int b, int c)
{
int round1 = (a > b) ? a:b;
int round2 = (round1 > c) ? round1:c;
int median = (round2 > b) ? b:round2;
printf("median = %d \n", median);
return;
}
/*MAX_INT FUNCTION*/
int max_int(int a, int b, int c)
{
int larger = (a > b)? a:b;
int largest = (larger > c) ? larger:c;
return largest;
}
void print_max(int a,int b, int c)
{
int max = max_int(a,b,c);
printf("MAX = %d\n", max);
return;
}
void print_triangle(int N)
{
//code here
return;
}
void print_centered_triangle(int N)
{
//code here
return;
}
void print_range(a,b)
{
//code here...prints range of numbers between a and b.
}
int main()
{
is_evenly_divisible(3,4);
is_evenly_divisible(4,4);
is_evenly_divisible(4,0);
printf("______________________\n");
print_max(3,2,4);
print_max(1,60,2);
print_max(0,0,4);
median_int(4,5,3);
return 0;
}