generated from nuwank7/IT1050-Tutorial-01
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tute04.c
49 lines (35 loc) · 829 Bytes
/
Tute04.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
/*Exercise 4 - Functions
Implement the three functions minimum(), maximum() and multiply() below the main() function.
Do not change the code given in the main() function when you are implementing your solution.*/
#include <stdio.h>
minimum ( int a, int b );
maximum ( int x, int y );
multiply ( int c, int d );
int main( void ) {
int no1, no2;
printf("Enter a value for no 1 : ");
scanf("%d", &no1);
printf("Enter a value for no 2 : ");
scanf("%d", &no2);
printf("%d ", minimum(no1, no2));
printf("%d ", maximum(no1, no2));
printf("%d ", multiply(no1, no2));
return 0;
}
minimum ( int a, int b ){
if ( a > b ){
return b;
}
else
return a;
}
maximum ( int x, int y ){
if ( x > y ){
return x;
}
else
return y;
}
multiply ( int c, int d ){
return c * d;
}