Computer Science, asked by rohitthorat1029, 3 months ago

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");
}
}
}

Answers

Answered by saritaishu2008
0

Answer:

soory shei what will didi djdu7e Rhys djdu7e ehdu6

Similar questions