C Programming Code Examples C > Miscellaneous Code Examples Program to Reverse the digits of a number in 3 Steps Program to Reverse the digits of a number in 3 Steps - Store Number in the Form of String - Reverse the String Using Strrev Function - Convert String to Number #include<stdio.h> #include<stdlib.h> #include<string.h> int main() { int j1, j2; char str[25]; printf("\nEnte the Number : "); scanf("%d", &j1); sprintf(str, "%d", j1); strrev(str); j2 = atoi(str); printf("\nReversed Number : "); printf("%d", j2); return (0); }