This is individual description list of program which is mentionmed in first page of JAVA, part of programming tutorial i will try to explanin more than 50 java * pattern program, Which are asked in interview and online exams and unveristy exam with diferrent logic for the same type of pattern
Top 100+ Sql Server Interview Questions
A palindromic number is a number that is the same when written forwards or backwards
always be same, i.e., of the form . The first few palindromic numbersare therefore are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 101, 111, 121.
class PalindromeExample
{
public static void main(String args[])
{
{
int r,sum=0,temp;
int n=555;//It is the number variable to be checked for palindrome
temp=n;
while(n>0)
{
{
r=n%10; //getting remainder
sum=(sum*10)+r;
n=n/10;
}
if(temp==sum)
System.out.println("palindrome number ");
else
System.out.println("not palindrome");
}
No comments:
Post a Comment