Computer Science, asked by vikasbhai, 1 year ago

write a program and check whether its a palindrome number or Perfect number

Answers

Answered by xyz75
1
palindrome no.

Input N
Copy=N
S=0
While N>0
C=N mod 10
S=S*10+C
N=int(N/10)
Wend
If copy=S then
Print"No. is palindrome"
else
Print"No.is not palindrome"
End if
End

Perfect no.
Input"Enter a number";N
S=0
For A =1to N/2
If N/A=int( N/A)then
S=S+A
End if
Next A
If S=N then
Print "No. is perfect "
Else
Print"No. is not perfect "
End if
End
Hope it helps:)

vikasbhai: please from java
xyz75: Sorry I don't know..it was not mentioned that it should be from Java so I answered.
Similar questions