HAY THANK FOR VISIT
<<<<<<LET'S START WITH ANOTHER QUESTION>>>>>>>>>>>>>
QUESTION---TO CHECK THAT THE GIVEN NUMBER IS PALENDROM OR NOT..
class Palendrom
{
void main(int n)
{
int d=0;int rev=0;int t=n;
while(n>0)
{
d=n%10;
rev=rev*10+d;
n=n/10;
}
n=t;
if(n==rev)
System.out.println("Palendrom number");
else
System.out.println("not a Panlendrom number");
}
}
input---121
output---

<<<<<<LET'S START WITH ANOTHER QUESTION>>>>>>>>>>>>>
QUESTION---TO CHECK THAT THE GIVEN NUMBER IS PALENDROM OR NOT..
class Palendrom
{
void main(int n)
{
int d=0;int rev=0;int t=n;
while(n>0)
{
d=n%10;
rev=rev*10+d;
n=n/10;
}
n=t;
if(n==rev)
System.out.println("Palendrom number");
else
System.out.println("not a Panlendrom number");
}
}
input---121
output---
No comments:
Post a Comment
HAY THAKYOU FOE VISIT