Using else if multiple times

Sep 13, 2014 at 12:47am
I had a programming exercise to do that seemed easy at the surface but hard to write. Is it normal to use else if, say 13 times in main? Why I ask is because
I am having to input 2 characters and evaluate both characters against a combination of string arrays and integers. Any advice would be greatly appreciated.
Sep 13, 2014 at 1:12am
It sounds like a loop or switch might work better, but it is hard to say from your description.
Sep 13, 2014 at 1:31am
Thanks for the reply. I will look into loop. I have used switch but my understanding is that it does not work with strings.
Sep 13, 2014 at 2:23am
No, switch does not work with string, but it does work with char.
Sep 13, 2014 at 7:53am
it is possible to write else if 13 times, but in that situation you should already use looping
Topic archived. No new replies allowed.