-
Notifications
You must be signed in to change notification settings - Fork 0
/
FUNCGREA.BAK
67 lines (65 loc) · 1.1 KB
/
FUNCGREA.BAK
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
#include<stdio.h>
#include<conio.h>
int swap(int a,int b){
if(a>b){
return a;
}
else{
return b;
}
}
int wap(int a,int b,int c){
int b1;
if(a>b){
b1=a;
}
else{
b1=b;
}
if(b1>c){
return b1;
}
else{
return c;
}
}
int infinity(int arr2[]){
int x,y=0;
for(x=0;x<5;x++){
if(y<arr2[x]){
y=arr2[x];
}
}
return y;
}
void main(){
int a,b,c,num,e,y;
int arr[5];
clrscr();
printf("Press 1 to find the greatest btw 2 numbers\n");
printf("Press 2 to find the greatest btw 3 numbers\n");
printf("Press 3 to find the greatest numbers of your choice\n");
scanf("%d",&num);
if(num==1){
printf("ENTER TWO NUMBERS\n");
scanf("%d %d",&a,&b);
e=swap(a,b);
printf("Greatest number btw the two is %d\n",e);
}
else if(num==2){
printf("ENTER THREE NUMBERS\n");
scanf("%d %d %d",&a,&b,&c);
e = wap(a,b,c);
printf("Greatest number btw the three is %d\n",e);
}
else if(num ==3){
printf("Enter all the numbers\n");
for(y=0;y<5;y++){
printf("Number %d = ",y);
scanf("%d",&arr[y]);
}
e = infinity(arr);
printf("Greatest number btw all numbers is %d\n",e);
}
getch();
}