Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package basicjavalipu2;
- import java.util.Scanner;
- class BasicJavaLipu2{
- public static void main(String args[]){
- Scanner in = new Scanner(System.in);
- int r,sum=0,temp;
- int n= in.nextInt();
- temp=n;
- while(n>0){
- r=n%10;
- sum=(sum*10)+r;
- n=n/10;
- }
- if(temp==sum)
- System.out.println("Armstrong number ");
- else
- System.out.println("not Armstrong");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement