Quote (TheProMaster @ Jan 30 2013 08:44pm)
you basically use cin << "enter your integer" << endl;
if whatever he entered = even do this
else
display its odd
its not aabout checking its about programming the system to tell you whether it is odd or even. use srand % 1 so that if the remainder of the number has a 1 its odd.
we did something similar to this in my first year
man your first year showed you allot.... (sarcasism)
@op disregard this guys post this is simple.
basically you use the modulus (%) operator and check to see if the result returns 0 or not.
ex:
Code
if(n % 2 == 0)
{
printf("Even\n");
}
else
{
printf("Odd\n");
}
if you dont know how to ask a user for input and store it in a variable yet i highly recommend that you google for a beginning tutorial to c++. i recommend cpluspus.com
edit:: self got to it before me qq lol
edit2:: as for your second problem just cin all your data into separate variables ex:
Code
int a,b,c,d,e;
cin << a << b << c << d << e;
then do a series of if statements to check which is greater
Code
if(a > b && a > c && a > d && a > e)
{
printf("a is the greatest\n);
}
This post was edited by AbDuCt on Jan 30 2013 08:12pm