#include <iostream>
usingnamespace std;
int main () {
//lets make a program for MAX and min valus
int a, b ,c ,d ,e ;
cout << "enter a number ";
cin >> a ;
cout << "enter ";
cin >> b ;
cout << "enter it again";
cin >> c;
cout << "enter pls";
cin >> d ;
cout << "last one ";
cin >> e ;
int max , min ;
max = a ;
if (b > max)
max = b ;
if (c> max)
max = c ;
if (d > max)
max = d ;
if (e > max)
max = e ;
//for mini
min = a ;
if (b < min)
min = b ;
if (c < min )
min = c ;
if (d < min);
min = d ;
if(e < min )
min = e ;
cout << "\n\nthe maximum value is "<<max<< endl ;
cout << "\n\n THe mimimum value is "<<min<< endl ;
return 0; }
You may want to store a,b,c,d,e in an array and find de max in a loop through the array, at least if you stil need them afterwards. If you don't need them consider a max macro or function during input.