0% found this document useful (0 votes)
8 views1 page

Lab_Program_classIX_ICSE

Uploaded by

tapaskumarmahato
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views1 page

Lab_Program_classIX_ICSE

Uploaded by

tapaskumarmahato
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

1. Write a program to enter two numbers and check whether they are co-prime or not.

[Two numbers are said to be co-prime, if their HCF is 1 (one).]


Sample Input: 14, 15
Sample Output: They are co-prime.
2. A Dudeney number is a positive integer that is a perfect cube such that the sum of its digits is equal to the
cube root of the number. Write a program to input a number and check and print whether it is a Dudeney
number or not.

Example:
Consider the number 512.
Sum of digits = 5 + 1 + 2 = 8
Cube root of 512 = 8
As Sum of digits = Cube root of Number hence 512 is a Dudeney number.
3. Write programs to find the sum of each of the following series:
i. S= 1-2+3-4+5-6+….+19-20
1 1 1 1 1
ii. S=1+ + + + +…+
2 3 4 5 10
4. Write a program to print the first 15 numbers of the Pell series. Pell series is such a series which starts from
1 and 2 , and subsequent numbers is the sum of twice the previous number and the number previous to
the previous number. Pell series: 1, 2, 5, 12, 29, 70, 169, 408, 985, 2378, 5741, 13860, …
5. Write a program to find the sum of 1st 10 numbers of Lucas series i.e. 2,1,3,4,7,11,18,…. Lucas series is
such a series which starting from 2 and 1, and subsequent numbers are the sum of the previous two
numbers.
6. Write a program to input a number and find whether the number is a Disarium number or not. A number is
said to be Disarium if sum of its digits powered with their respective positions is equal to the number itself.

Sample Output: 135 ⇒ 11 + 32 + 53 = 135


Sample Input: 135

So, 135 is a Disarium number.


7. Write a program in Java to display the following pattern:

3
44
555
6666
77777
8. Write a program in Java to find the sum of the given series:
S = 1! + 2! + 3! + …. + n!
9. Write a program in Java to display the following patterns.
1 * * * *
2 2 * * *
3 3 3 * *
4 4 4 4 *
5 5 5 5 5
10. Write a program in Java to display the following patterns.

ABCDE
ABCD
ABC
AB
A

You might also like