in Education by
Help needed Please write a program to check whether a number is special number or not . 100 points Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
import java.util.*; class special { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int n,i,d,sum=0,fact=0; System.out.print(“Enter an integer:”); n=sc.nextInt(); i=n; while(i>0) { d=i%10; i/=10; for(int a=1;a<=d;a++) { fact*=a; } sum+=fact; fact=0 } if(sum==n) System.out.println(“Special Number”); else System.out.println(“Not a Special Number”); } HOPE IT HELPS YOU !!

Related questions

0 votes
    write a program to check whether the entered number is positive or negative or zero Select the correct answer from above options...
asked Dec 17, 2021 in Education by JackTerrance
0 votes
    write a program to input a number. check and display whether it is divisible by 100 Select the correct answer from above options...
asked Dec 17, 2021 in Education by JackTerrance
0 votes
    write a program in Java to input a number and print if it is a special number or not. do this program using ... nested and while loop . Select the correct answer from above options...
asked Dec 1, 2021 in Education by JackTerrance
0 votes
    write a program to input a year example 1994 and check whether it is a leap year Select the correct answer from above options...
asked Dec 6, 2021 in Education by JackTerrance
0 votes
    write a program to input a year example 1994 and check whether it is a leap year Select the correct answer from above options...
asked Dec 5, 2021 in Education by JackTerrance
0 votes
    write a program to input a year example 1994 and check whether it is a leap year Select the correct answer from above options...
asked Nov 26, 2021 in Education by JackTerrance
0 votes
    Write a program which sends the name of a text file from the client to server and display the message on the ... file present or not. Select the correct answer from above options...
asked Dec 1, 2021 in Education by JackTerrance
0 votes
    Write a script in python to check whether your age is “major” or “minor” Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    Mathematical function to check whether a number is positive or negative in c# Select the correct answer from above options...
asked Dec 20, 2021 in Education by JackTerrance
0 votes
    write a program to enter a sentence and check if it contains palindrome words or not. if yes then count and ... present. Java class 10 Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    Write a program in Java to input any age and determine whether the age is valid or  invalid. If age is ... is valid otherwise invalid. Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
    WAP in java to check whether the sum of second and third digit of a 4 digit no. , is even or odd? Select the correct answer from above options...
asked Dec 23, 2021 in Education by JackTerrance
0 votes
    Algorithm to find whether the given number is palindrome or not Select the correct answer from above options...
asked Dec 12, 2021 in Education by JackTerrance
0 votes
    hi friends hope you all are doing great Plz answer my question please do not give invalid answers Write a program ... number. Thank you Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    write a program to input number and print wether it is even or odd. Select the correct answer from above options...
asked Dec 21, 2021 in Education by JackTerrance
...