Full_Java_Programs_Wipro_WILP
Full_Java_Programs_Wipro_WILP
Output: Even
5. Reverse a Number
public class ReverseNumber {
public static void main(String[] args) {
int num = 1234, rev = 0;
while (num != 0) {
rev = rev * 10 + num % 10;
num = num / 10;
}
System.out.println("Reversed Number: " + rev);
}
}
Output: Even
Output: Even
12. Find the Largest of Two Numbers
public class LargestOfTwo {
public static void main(String[] args) {
int a = 10, b = 20;
if (a > b)
System.out.println("Largest is: " + a);
else
System.out.println("Largest is: " + b);
}
}
Output: Even
Output: Even
Output: Even
27. Find the Largest of Two Numbers
public class LargestOfTwo {
public static void main(String[] args) {
int a = 10, b = 20;
if (a > b)
System.out.println("Largest is: " + a);
else
System.out.println("Largest is: " + b);
}
}
Output: Even
Output: Even
Output: Even
42. Find the Largest of Two Numbers
public class LargestOfTwo {
public static void main(String[] args) {
int a = 10, b = 20;
if (a > b)
System.out.println("Largest is: " + a);
else
System.out.println("Largest is: " + b);
}
}
Output: Even
Output: Even