Divide a number by 10 will give you a digit as int sample:
256/10=25.6==25
25/10=2.5==2
256%10=6
25%10=5
2%10=2
This video will surely help:
Code:
#include<stdio.h> int main(){ int N,R; printf("Enter the number to reverse: "); scanf("\n%d",&N); R=0; while(N!=0) { R=R*10+N%10; N=N/10; } printf("Reverse: %d",R); return 0; }