Gah! Why did you change i to num, and change the if to "if (num)"? You were so close. You also still haven't rearranged the order of your assignments! For the THIRD AND FINAL TIME, GET THE BIGGER...
Type: Posts; User: anduril462
Gah! Why did you change i to num, and change the if to "if (num)"? You were so close. You also still haven't rearranged the order of your assignments! For the THIRD AND FINAL TIME, GET THE BIGGER...
I took the code you posted, and made the edits you said you made, and everything looked fine. You know this wont work for single digit numbers, right? Can we get the full code and some sample input...
You had two erroneous semicolons. Did you get both of them?
Try being a little more consistent and sensible about your { braces }. Pick a good indentation/brace style (K&R, 1TBS, Allman and BSD KNF are the most common). It might help to put braces around...
Since you're a noob, skip the weird ?: business for now. Stick with:
if (a > b)
i = a; // i is on the left, so we assign to i the value in a
else
i = b;
Otherwise, i is...
Where did you put those statements? What was the last value your program set the variable to before printing? You have to make your switch statements exclusive, i.e. don't do switch(tensDig) or...
How about printf(word);?
if (a>b){
a=i;}
else
b=i;
Just noticed this is backwards. You want i = a; and i = b; to make i contain the greater of the two. A shorthand for this common if-else...
[QUOTE=thomasjiii;1001990]I am making a program that will take any two two-digit numbers determine the largest and display it in words using if/else and switch statements. I'm kinda stuck. I know how...