I have a small simple school project for c programming. I am supposed to write a number and get the reverse of it and I couldn't understand how this code works. So, I need someone to explain to me what happens in the while loop, and why we use these operations, and whats %10?
Thanks!
/* Reverse number using while loop */
#include<stdio.h>
int main()
{
    int num, reverse=0;
    scanf("%d",&num);
    while(num > 0)
    {
        reverse= reverse*10;
        reverse = reverse + (num%10);
        num = num/10;
    }
    printf("%d",reverse);
    return 0;
}