1st tooo much common sense comment :
second ;
while (num != 0)
{
digit= num%=10; // you are setting digit to the last number of 10 each time this loop runs. So you end up with a 1 digit number
num/=10;
}
To reverse the number first find out its degree, i.e 1 has a degree
of 0, 10 has a degree of 1, 100 has 2, 1000 has 3 ....
The use the mod operator to extract the last number of
the value passed from the parameter, and multiply it with
the total degree. Then divide degree by 10, and again
add the num%10 * degree .. and repeat, until !deg