generated from nuwank7/IT1050-Tutorial-01
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTute04.c
40 lines (36 loc) · 841 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
/*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>
int minimum(int No1,int No2);
int maximum(int No1,int No2);
int multiply(int No1,int No2);
int main() {
int no1, no2;
printf("Enter a value for no 1 : ");
scanf("%d", &no1);
printf("Enter a value for no 2 : ");
scanf("%d", &no2);
printf("Minimum is :%d\n", minimum(no1, no2));
printf("Maximum is :%d\n", maximum(no1, no2));
printf("Multiply is :%d\n", multiply(no1, no2));
return 0;
}
int minimum(int No1,int No2)
{
if(No1>No2)
{
return No2;
}
}
int maximum(int No1,int No2)
{
if(No1>No2)
{
return No1;
}
}
int multiply(int No1,int No2)
{
return No1*No2;
}