Write a program in Java:-
Input 2 numbers and check whether they are equal or not.
Share
Write a program in Java:-
Input 2 numbers and check whether they are equal or not.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Java Program to Accept two Integers and Check if they are Equal
public class Equal_Integer.
int m, n;
Scanner s = new Scanner(System.
System. out. print("Enter the first number:");
m = s. nextInt();
System. out. print("Enter the second number:");
n = s. nextInt();
if(m == n)
There are three ways to reverse a number in Java.
1) Using while loop
2) Using for loop
3) Using recursion
4) Reverse the number without user interaction
1 Input your number and press enter:
145689
Reverse of input number is: 986541
2 Input your number and press enter:
56789111
Reverse of specified number is: 11198765
3 Input your number and press enter:
5678901
Reverse of the input number is:1098765