This program checks whether a number is a Special Number or not. A number is said to be a special number when the sum of the factorial of its digits is equal to the number itself. Example - 145 is a Special Number as 1!+4!+5!=145. Program- /*import java.util.*; public class SpecialNumberCheck { public static void main(String args[]) { Scanner ob=new Scanner(System.in); System.out.println("Enter the number to be checked."); int a=ob.nextInt(); int sum=0,b=a; while(a!=0)//or a>0 { int rem=a%10; int fact=1; for(int i=1;i<=rem;i++) ...
Get guidance from the experts on the subject. Prepare yourself for the competitive world ahead by right approach and a clear understanding of concepts of your subjects
Comments
Post a Comment
Please, do not enter any spam link in the comment box.