write a program to check if the number is a special no or not using scanner class
Answers
Answered by
0
Answer:
Here is the logic I developed.
import java.io.*;
import java.util.*;
public class Solution {
static long[] array = {1,1,2,6,24,120,720,5040,40320,362880};
static boolean solve(int num) {
String S = String.valueOf(num); //Convert Number to String.
long sum = 0;
for(int i=0;i<S.length();i++) {
please mark the brainliest
Explanation:
Answered by
6
Answer:
We input the number through Scanner class and sum is variable which stores the sum of factorial of digits. A temp variable is taken. The while loop calculates the sum of factorial of digits. Inside the loop factorial of last digit is calculated and added to the sum.
Explanation:
See to my attachment.
Hope it will help you.
Attachments:
Similar questions