Computer Science, asked by Hazardous7, 8 months ago

Write a program in Java to accept any two positive integers only and check whether their last digit is equal or not .

Answers

Answered by Anonymous
1

Answer:

you put me first Brainlist mate

next I will give the correct answer

Answered by k047
0

In this post, we will write two java programs, first java programs checks whether the specified number is positive or negative. The second program takes the input number (entered by user) and checks whether it is positive or negative and displays the result.

→ If a number is greater than zero then it is a positive number

→ If a number is less than zero then it is a negative number

→ If a number is equal to zero then it is neither negative nor positive.

Lets write this logic in a Java Program.

Example 1: Program to check whether the given number is positive or negative

In this program we have specified the value of number during declaration and the program checks whether the specified number is positive or negative. To understand this program you should have the basic knowledge of if-else-if statement in Core Java Programming.

Similar questions