Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int max4(int a, int b, int c, int d) {
- int x;
- if(a>=b&&a>=c&&a>=d) x=a;
- else if (b>=a&&b>=c&&b>=d) x=b;
- else if (c>=a&&c>=b&&c>=d) x=c;
- else x=d;
- return x;}
- int main(){
- int a,b,c,d;
- cout<<"A=";
- cin>>a;
- cout<<"B=";
- cin>>b;
- cout<<"C=";
- cin>>c;
- cout<<"D=";
- cin>>d;
- cout<<endl<<max4(a,b,c,d)<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment