Created
July 12, 2020 04:22
-
-
Save Abhayparashar31/6dad720724474203ac6566d5c1d67627 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int max_of_four(int a, int b, int c, int d) | |
{ | |
int max; | |
if((a>b) && (a>c) && (a>d)) | |
max = a; | |
if((b>a) && (b>c) && (b>d)) | |
max = b; | |
if((c>a) && (c>b) && (c>d)) | |
max = c; | |
if((d>a) && (d>b) && (d>c)) | |
max = d; | |
return max; | |
} | |
int main() | |
{ | |
int a, b, c, d; | |
cin>>a>>b>>c>>d; | |
int ans = max_of_four(a, b, c, d); | |
cout<<ans; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment