Fill in the blanks with appropriate java statements :
void palin(int n)
{
int d, num, rev=0;
num = (a)______;
while( (b) ________)
{
d = n%10;
rev =(c)________;
n=n/10 ;
}
if (rev==(d)______)
System.out.println(num+'' is a Palindrome no'') ;
else
System.out.println(num+'' is not a Palindrome no'') ;
}
(a) 1. m 2. n 3. p [ 1 ]
(b) 1. m!=0 2. p!=0 3. n! =0 [ 1 ]
( c) 1. (rev*10)+d 2. rev + d 3. (rev *1)+d [ 1 ]
(d) 1. n 2. num 3. d
Answers
Answered by
0
XYADGt SC hijdxvjgfdvgydfjjbvd
Answered by
1
Program:
Fill in the blanks with appropriate java statements :
void palin(int n)
{
int d, num, rev=0;
num = n;
while(d>0)
{
d = n%10;
rev =(rev*10)+d;
n=n/10 ;
}
if (rev==num)
System.out.println(num+'' is a Palindrome no'') ;
else
System.out.println(num+'' is not a Palindrome no'') ;
}
Similar questions