Sunday, July 24, 2011

Reverse the given number

Hi,
Here is the logic to reverse the given number
public
{


temp = num;

{
rev = rev * 10 + temp % 10;
temp = temp/10;
}

}
int ReverseNumber(int num)int temp = 0;int rev = 0;while (temp != 0)return rev;

No comments:

Post a Comment