A question about "if" function on C++?
I am trying to do a HW. It is about identify an input from the user, then apply the equation to what was inputed, then show the answer. i.e. assume that i ask for w,x,y,z from the user. If the user inputs 3, 4, 5, 5, my equation will be x+y+z, as 4+5+5 = 14. (ignore the 3 for now) but the equation will apply "if" w =3.
code:
if ( w = 3)
answer = x+y+z
ok, thats kool. However, what if the input for "w" is suppose to be a letter? let say if the first input is letter "S", then do the equation. and not a number? when i do that, it wont compile!
i am sure it will not be
if (w = "C") or if (w = C)
any idea plz? or am i not clear enuff?