#include <iostream>
using namespace std;
int main()
{
char a, b, c, d, e, f, max;
cout << "enter a b c: ";
cin >> a >> b >> c >> d >> e >> f;
max = a;
if(b>max)
max = b;
if (c>max)
max = c;
if (d>max)
max = d;
if (e>max)
max = e;
if (f>max)
max = f;
cout << "max is " << max << "\n";
return 0;
}
Ok I need to add a break somewhere so if input is 123 or 1245..it doesnt just work for input of 5 CHAR
* Im thinking of a for while loop but not too sure
* Or a variable to keep the actual "current maximum" and, every time the user inputs a new number, have it compare the "current maximum" with the new number: if the current maximum is greater it would simply discard the new input, if it's less, instead, the new input becomes the new maximum.
* Or move a cin inside the loop for a check
thanks all :)))