Tag Archives: conditional operator

why use nested if-else statement if you can write it in one line?

when i’m showing my assignment code,
maxout = (strcmp(JenisAkaun,”TETAP”) == 0) ? 500 : (strcmp(JenisAkaun,”BIASA”) == 0) ? 10 : 0;
they look shocked like they never do programming before.. more surprising, even most of my friends from fsksm didn’t know this kind of coding exist.. lol!!! if you also one of them, then you better read [...]