Professional Documents
Culture Documents
Class9 Ut2 Worksheet
Class9 Ut2 Worksheet
Class - IX
SUB - WORKSHEET
1) Write a program to check and display whether a number input by the user is a composite number
or not.
A number is said to be composite , if it has one or more than one factors excluding 1 and the number
itself. Example – 4 , 6, 8 , 9 , …….
2) Write a Java Program to find the smallest digit of an integer that is input by user:
Sample input : 6524 , Sample output : Smallest digit is 2.
3) Write a menu driven program to calculate :
a)Area of circle = p * r2 , where p = 22 / 7.
b) Area of square = side * side.
c) Area of rectangle = length * breadth .
Enter ‘c ‘ to calculate area of circle , ‘s ‘ to calculate area of square and ‘r ‘ to calculate area of
rectangle.
4) Write a Java program to accept two numbers and find the Greatest Common Divisor (G.C.D) of
those numbers.
Sample Input : 25 , 45
Sample output : The Greatest Divisor : 5
5) Write a program to calculate the sum of all positive even numbers and sum of all negative odd
numbers from a set of numbers. The program should exit when a 0(zero) is entered.
6) Write a program to accept a number and check whether the number is a Palindrome or not.
(A palindrome number is a number that remains the same when its digits are reversed .For
example 18381).
7. Write a program to input a number (integer type ) . Print its factors.