👤

Scrieti un algoritm care determina si afiseaaza maximul a 3 numere

Răspuns :

int maxim(int a, int b, int c)
{ if(a>b && b>c)
return a;
else
if(b>a && a>c)
return b;
else
return c;
}
int main
{ int x,y,z;
cout<<"x="; cin>>x;
cout<<"y="; cin>>y;
cout<<"z="; cin>>z;
cout<<maxim(x,y,z);
return 0;
}