in Education by
Write a program in Java to print all palindromic numbers between 150-250. Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
Answer: class GFG { // A function to check // if n is palindrome static int isPalindrome(int n) { // Find reverse of n int rev = 0; for (int i = n; i > 0; i /= 10) rev = rev * 10 + i % 10; // If n and rev are same, // then n is palindrome return(n == rev) ? 1 : 0; } static void countPal(int min, int max) { for (int i = min; i <= max; i++) if (isPalindrome(i)==1) System.out.print(i + ” “); } public static void main(String args[]) { countPal(150, 250); } }

Related questions

0 votes
    write a program to enter a sentence and check if it contains palindrome words or not. if yes then count and ... present. Java class 10 Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    Write a python program to print first n(entered by user) even natural numbers. Select the correct answer from above options...
asked Dec 25, 2021 in Education by JackTerrance
0 votes
    write a program in python to obtain 3 numbers and print their sum. Select the correct answer from above options...
asked Nov 29, 2021 in Education by JackTerrance
0 votes
    Write a program to store 10 names in an array. Arrange these in alphabetical orderby sorting. Print the sorted list. ... , LUCY, etc. Select the correct answer from above options...
asked Dec 12, 2021 in Education by JackTerrance
0 votes
    write a java program to print areaof an equilateral triangle . (without using scanner) Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    How to write a program in JAVA to print the sum of ASCII values of a particular word input ? Select the correct answer from above options...
asked Dec 28, 2021 in Education by JackTerrance
0 votes
    Write a program in JAVA to input a sentence reverse every word and print . Please answer someone. Select the correct answer from above options...
asked Dec 13, 2021 in Education by JackTerrance
0 votes
    Write a program in JAVA to print : 1 12 123 1234 12345 Select the correct answer from above options...
asked Dec 13, 2021 in Education by JackTerrance
0 votes
    Write a program in JAVA to print this pattern :- 1 12 123 1234 12345 Select the correct answer from above options...
asked Dec 13, 2021 in Education by JackTerrance
0 votes
    write a program in Java to input a number and print if it is a special number or not. do this program using ... nested and while loop . Select the correct answer from above options...
asked Dec 1, 2021 in Education by JackTerrance
0 votes
    write a Java program to input 10 non-zero numbers in an array and display the count of even and odd numbers. URGENT! Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    write a program in java to accept a number and display the new number after removing all the zeros Select the correct answer from above options...
asked Dec 10, 2021 in Education by JackTerrance
0 votes
    can anyone please help me out for this question Write a program to create two threads, so one thread will print ... between 11 to 20. Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    can anyone please help me out for this question Write a program to create two threads, so one thread will print ... between 11 to 20. Select the correct answer from above options...
asked Dec 18, 2021 in Education by JackTerrance
0 votes
    Write an algorithm and draw a flowchart to print prime numbers from 1 to 50 Select the correct answer from above options...
asked Dec 10, 2021 in Education by JackTerrance
...