Conditional Statement Introduction
Conditional is an essential part in programming. You can do many things with it. In the past, I read a book about basic programming. The author said that most of programs written from various language are only contain repetition and conditional. So this time I’ll give a solution from 30 days challenge code from hackerrank . This is really a simple program about selection of odd and even number. Okay, the image above is the condition which we should implement in listing code. It’s quite easy right. First, you input integer number (not decimal). Remember the constraint is number you input is from 1 to 100. .Then you start with selection whether the number is odd or not. In mathematic we all know that odd number is an integer number that can not be divided by 2. So if we operate it with modulo operation, odd number will result 1. Odd number should print “Weird”. Back again, if the number is not odd then do a selection again for even number. The range already men...