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

Java Looping Programs

Uploaded by

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

Java Looping Programs

Uploaded by

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

1.

Factorial of a number
5 = 5 x 4 x 3 x 2 x 1 = 120
2. Printing table of a number
3
3 x 1 = 3
3 x 2 = 6
.......
3. Finding HCF
4. Finding LCM
5. Converting Decimal to Binary
14 = 1110
6. Converting Binary to Decimal
1110 = 14
7. Checking whether the number is Niven or not.
126%(1+2+6) ==0
8. Checking whether the number is Neon or not.
9
sqaure of 9 = 81
8 + 1 = 9
9. Checking whether the number is Palindrome or not.
121, 1331, 525, 626, 111, .............
10. Checking whether the number is Armstrong or not.
1, 153 , 407 ,..................
1 -> Cube of 1 = 1
153 -> Cube of 1 + cube of 5 + Cube of 3
1 + 125 + 27 = 153
407 -> Cube of 4 + cube of 0 + Cube of 7
64 + 0 + 343 = 407

11. Checking whether the number is Prime or not.


2,3,5, 7, 11, 13, 17, 19, ..................
12. Checking whether the number is Perfect or not.
6 -> Factors of 6 = 1, 2, 3 (excluding 6)
= 1 + 2+ 3 = 6
28 - > Factors of 28 = 1,2,4, 7, 14 (excluding 28)
= 1+ 2+ 4+ 7+ 14
= 28
13. Checking whether the number is Spy or not.
22, 123, 321, 213, ...................
22 -> 2 x 2 = 2 + 2
123 -> 1 x 2 x 3 = 1 + 2 + 3
321 -> 3 x 2x 1 = 3 + 2 + 1
14. Printing the factors of a number.
6 = 1 2 3 6
12 = 1 2 3 4 6 12
15. Printing the Fibonacci series
0 1 1 2 3 5 8 13 21 ................
16. Printing the sum of different pattern of series:
a) 1 - 2 + 3 - 4 + 5 - 6 + ...............
b) 2 + 5 + 8 + 11 + 14 + 17.........
c) x/1! + x^2/2! + x^3/3! + ..........
d) -x + x^5 - x^9 + x^13 - ............
PROGRAM THAT SHOULD BE DONE!!!!!

You might also like