Page 30 - PlusGPT_V2.1_C8_Flipbook
P. 30

SOME MORE PROGRAMS



                   Program 5: To test whether a given number is positive.










                  You will get the following output:
















                   Program 6: To test whether a given number is positive or negative.













                  You will get the following output:




















                             Let’s BaCk-uP


                         The if statement is the simplest conditional statement.
                         In the if…else statement, if the condition evaluates to True, the indented block following the if
                       statement is executed, otherwise the indented block after the else statement is executed.





                  28    Premium Edition-VIII
   25   26   27   28   29   30   31   32   33   34   35