import java.util.*;
class Assignment_11
{
public static void main()
{
Scanner sc=new Scanner(System.in);
System.out.println ("1.Checks value for palindrome");
System.out.println ("2.Checks value for perfect number");
System.out.println ("Enter your choice");
int ch=sc.nextInt();
System.out.println("Enter number");
int n=sc.nextInt();
switch(ch)
{
case 1:
int r=0,d,bk=n;
while(bk!=0)
{
d=bk%10;
r=r*10+d;
bk=bk/10;
}
if(r==n)
System.out.println("Value is a palindrome number");
else
System.out.println("Value is not a palindrome number");
break;
case 2:
int i,s=0;
for (i=0;i
{
if(n%i==0)
s=s+i;
}
if(s==n)
System.out.println("number is perfect");
else
System.out.println("number is not perfect");
break;
default:
System.out.println("invalid choice");
}
}
}
himanshu2006vps:
so what to do
Answers
Answered by
0
Answer:
hii
Explanation:
sorry i can't understand ur question
Similar questions
Physics,
1 month ago
Chemistry,
3 months ago
Chemistry,
3 months ago
World Languages,
9 months ago
Science,
9 months ago