A
ashu
Dear friends, i am trying to solve one question about word counting
and i am surprise by statement behaviors,
actully i want to check if is a character not a space,tab or newline,
i am not giving full code.
1st statement :
if(c==' '|| c=='\n' || c== '\t') {then go to next character }
else ( increase no of word}
it checks if character is a space,tab or newline and i will do nothing
with it.else i increase no of word. works fine
2nd statement :
if(c!=' '|| c!='\n' || c!='\t')
{ increase no of word}
i want to directly check if not a space,tab or newline but this
statement is doing nothing , why?
example : this is a test
statement 1st works fine returns 2
but statement 2nd does nothing.
and i am surprise by statement behaviors,
actully i want to check if is a character not a space,tab or newline,
i am not giving full code.
1st statement :
if(c==' '|| c=='\n' || c== '\t') {then go to next character }
else ( increase no of word}
it checks if character is a space,tab or newline and i will do nothing
with it.else i increase no of word. works fine
2nd statement :
if(c!=' '|| c!='\n' || c!='\t')
{ increase no of word}
i want to directly check if not a space,tab or newline but this
statement is doing nothing , why?
example : this is a test
statement 1st works fine returns 2
but statement 2nd does nothing.