C programming for getting revers number.

#include <stdio.h>
#include <stdlib.h>
int main(){
 
    int num,rev=0;
 
    printf("Please enter a integer.");
    scanf("%d", &num);
 
    while(num){
        rev = rev*10+num%10;
        num = num/10;
    }
        printf("Result is : %d", rev);
 
    return 0;
}