Number Programs in java ICSE Part-2
Number Programs in Java ICSE Part-2: solved Java program for ICSE Class 10 Computer Applications with complete BlueJ code, explanation and sample output.
Watch java videos
Number Programs in java ICSE has some important number programs for the ICSE students.

Number Programs in java ICSE
- Palindrome number:- Palindrome number is a number when it is reversed, it remains same. (For example: 131, when You reverse it it doesn't change)
import java.io.*;
class palindrome
{
public static void main()throws IOException
{
BufferedReader br=new BufferedReader (new InputStreamReader(System.in));
System.out.println("Give a number");
int num=Integer.parseInt(br.readLine());
int rem;
int n=num;
int rev=0;
do
{
rem=num%10;
rev=rev*10+rem;
num=num/10;
}while(num!=0);
{
if(rev==n)
System.out.println("This is a palindrome number");
else
System.out.println("This is not a palindrome number");
}
}
}
I/P:- 151
O/P: This is a palindrome number
I/P:- 125
O/P: This is not a palindrome number
2.Sum of the digits:- This programs Takes a number from the user and gives you the sum of the digits of the number.
import java.io.*;
class sum
{
public static void main()throws IOException
{
BufferedReader br=new BufferedReader (new InputStreamReader(System.in));
System.out.println("Give a number");
int num=Integer.parseInt(br.readLine());
int rem;
int n=num;
int sum=0;
do
{
rem=num%10;
sum+=rem;
num=num/10;
}while(num!=0);
System.out.println("The number you have entered is "+n);
System.out.println("The sum of the digits is" +sum);
}
}
I/P:- 125
O/P: The number you have entered is
The sum of the digits is 8
3. Reverse the number:- This program takes a number from the user, reverses it and then prints it on the terminal window.
import java.io.*;
class Reverse
{
public static void main()throws IOException
{
BufferedReader br=new BufferedReader (new InputStreamReader(System.in));
System.out.println("Give a number");
int num=Integer.parseInt(br.readLine());
int rem;
int n=num;
int rev=0;
do
{
rem=num%10;
rev=rev*10+rem;
num=num/10;
}while(num!=0);
System.out.println("The original number is "+n);
System.out.println("The reverse of the number is "+rev);
}
}
I/P:- 157
O/P: The original number is 157
The reverse of the number is 751
Number Programs in java ICSE
String Handling in JAVA
Related Posts
Continue learning with these related articles

String Methods in Java for ICSE Class 10: 25 Output Questions with Answers
ICSE Class 10 Computer Applications practice on String class methods: length, charAt, indexOf, lastIndexOf, substring, replace, trim, compareTo, equals and more, with 25 board-style output questions and step-by-step answers.

Special Number Programs in Java for ICSE: Armstrong, Spy, Neon, Disarium, Pronic and More
Every special number asked in ICSE Computer Applications – prime, perfect, Armstrong, palindrome, automorphic, neon, spy, Niven, duck, buzz, Disarium, special and pronic numbers – with definitions, examples and one complete Java program that checks them all.

Math Library Methods in Java for ICSE Class 9 (with Outputs)
ICSE Class 9 Computer Applications notes on the Java Math class: sqrt, cbrt, pow, abs, max, min, ceil, floor, round, rint and random, with return types, tricky negative-number outputs and Java expressions for formulas.