I'm trying to write this program that counts word length repetitions
I'm using if statements three layers deep, but the program seems to ignore the first two layers and only recognizes the third.
if( r1==0 )
if(s1 != " " )
I know I'm supposed to use brackets. I tried that too so it would look like:
but it still did the same thing.
How can I make sure that all the conditions I want to impose are taken together, with none being ignored? Should I be using if statements, or would something else work better? I was thinking that i could cut down on one layer by saying:
if(s1 != " ")
but the first condition is still ignored it seems.
is there a way to put all three conditions inside a single if statement?
Thanks for any help anyone can lend me.