Java Program – to check for the negative number using the if-else statement

Output: