Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  pal.java
Language: JAVA
Code:
import java.io.*;
import java.util.*;
class pal{
    public static void main(String arg[]){
        int no,no2,rem,fact=1,sum=0;
        Scanner in=new Scanner(System.in);
        no=in.nextInt();
        no2=no;
        while(no>0){
            rem=no%10;
            while(rem>0){
           fact=fact*(rem);
           rem--;
            }
            sum=sum+fact;
            no=no/10;
            
        }
        if(sum==no2){
            System.out.println("st");
        }
        else{
            System.out.println("not st");
        }
    }
}          
Comments: