forked from Ankur-Kumar-Gupta/Programming_Practice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
max3numfunc.cpp
53 lines (52 loc) · 1.07 KB
/
max3numfunc.cpp
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
#include<iostream>
using namespace std;
void max(int a,int b,int c)
{ if(a==b&&b==c)
{
cout<<"All three inputs are equal";
}
else if(a>b&&a>c)
{
cout<<"1st is maximum";
}
else if(b>a&&b>c)
{
cout<<"2nd is maximum";
}
else
{
cout<<"3rd is maximum";
}
}
void min(int a,int b,int c)
{ if(a==b&&b==c)
{
cout<<"All three inputs are equal";
}
else if(c<a&&c<b)
{
cout<<"3rd is minimum";
}
else if(b<a&&b<c)
{
cout<<"2nd is minimum";
}
else
{
cout<<"1st is minimum";
}
}
int main()
{
int a,b,c;
cout<<"Enter 1st Number: ";
cin>>a;
cout<<"Enter 2nd number: ";
cin>>b;
cout<<"Enter 3rd number: ";
cin>>c;
max(a,b,c);
cout<<endl;
min(a,b,c);
return 0;
}