reverse a integer in java
while(num != 0)
{
int digit = num % 10;
reversed = reversed * 10 + digit;
num /= 10;
}
reverse a integer in java
while(num != 0)
{
int digit = num % 10;
reversed = reversed * 10 + digit;
num /= 10;
}
Reverse int
bool is_palindrome(unsigned long long int num)
{
int temp; // Will hold temporary nums as we strip off digits
int remainder;
unsigned long long int reversed=0;
temp = num;
while(temp>0)
{
remainder = temp%10;
reversed = (reversed*10)+remainder;
temp = temp/10;
}
if(reversed==num)
return true;
else
return false;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us