This code asks the user to enter an integer value, the program determines whether the number entered is negative or positive.
In the code
an if else statement is used. A variable(number) is declared to hold the data
entered by the user.
If the condition “number<0” is true, the
program displays “you have entered a negative number” but if the condition is
false, the program displays “you have entered a positive number”.
When the above code is compiled and executed and 8 is entered the result displays


0 Comments