Posts

Showing posts from May, 2021

Ugly Number in Java

Image
 Ugly Number Question :   Write a program to accept a number and check whether it is Ugly number or not. Ugly Number : An Ugly number is a positive integer whose prime factors are limited to 2, 3, and 5 First 11 Ugly Numbers : 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15 Example :- Factors of 12 : 1, 2, 3, 4, 6, 12 Prime Factors of 12 : 2, 3 Prime Factorization : Writing a number as products of its prime factors. 12 : 2 X 2 X 3 = 12 

Magic Composite Number in Java

Image
  Magic Composite Number Question :   Write a program to accept a number and check whether it is a Magic Composite Number or not. Magic Composite Number : A Magic Composite Number is a positive integer which is composite as well as a magic number. First 6 Magic Composite Numbers : 10, 28, 46, 55, 64, 82 Magic Number : A Number is said to be a Magic Number if the sum of its digits are calculated till a single digit is obtained by recursively adding the sum of its digits. If the single digit comes to be 1 then the number is a Magic Number. 199 = 1 + 9 + 9 = 19     19 = 1 + 9 = 10     10 = 1 + 0 = 1  Composite  Number : A composite number is a number that has more than two factors.

Bell Number Triangle Pattern

Image
Bell Number Triangle Pattern in Java Question :   Write a program to print the following pattern. Bell Number Triangle Pattern