Posts

Showing posts from 2023

Increasing and Decreasing Number in Java

Image
Increasing and Decreasing Number in Java Question :   Write a program to check whether a number is Increasing Number or Decreasing Number? Increasing Number :  In an integer traversing from left to right if the current digit is greater than or equal to the previous digit, the number is known as increasing numbers. Ex : 23689 Decreasing Number :  In an integer traversing from left to right if the current digit is less than the previous digit, the number is known as decreasing numbers. Ex : 98632 Note  : A number which is neither increasing nor decreasing is Bouncy Number. * To understand the program clearly watch this video :  Increasing/Decreasing Number in Java

Krishnamurthy Number in Java

Image
  Krishnamurthy Number in Java Question :   Write a program to check whether a number is Krishnamurthy number or not? Krishnamurthy Number : A number whose sum of the factorial of digits is equal to the number itself. Examples :- 145 1! + 4! + 5! = (1 X 1) + (4 X 3 X 2 X 1) + (5 X 4 X 3 X 2 X 1) = 1 + 24 + 120 = 145 Output : It is a Krishnamurthy Number 55 5! + 5! = (5 X 4 X 3 X 2 X 1) + (5 X 4 X 3 X 2 X 1) = 120 + 120 = 240 Output : It is not a Krishnamurthy Number Note  : To understand the program clearly watch this video :   Krishnamurthy Number in Java

Bouncy Number in Java

Image
Bouncy  Number in Java Question :   Write a program to check whether a number is Bouncy Number or not? Bouncy Number : A positive integer that is neither in increasing nor decreasing number is called a bouncy number. In other words, A number whose digits are unsorted. Increasing Number : In an integer traversing from left to right if the current digit is greater than or equal to the previous digit, the number is known as increasing numbers. Ex : 23689 Decreasing Number : In an integer traversing from left to right if the current digit is less than the previous digit, the number is known as decreasing numbers. Ex : 98632 Example of Bouncy Number : 13174, 101, 15296 etc. Note : There is no Bouncy Number between 1 to 100. Note  : To understand the program clearly watch this video :  Bouncy Number in Java