Skip to content

Commit

Permalink
Merge pull request seeditsolution#294 from lokeshsinghi/patch-1
Browse files Browse the repository at this point in the history
ReverseNumber.c
  • Loading branch information
seeditsolution authored Oct 2, 2020
2 parents 24a719e + 20d790a commit 7a96e8d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ReverseNumber.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <stdio.h>
int main() {
int n, rev = 0, remainder;
printf("Enter an integer: ");
scanf("%d", &n);
while (n != 0) {
remainder = n % 10;
rev = rev * 10 + remainder;
n /= 10;
}
printf("Reversed number = %d", rev);
return 0;
}

0 comments on commit 7a96e8d

Please sign in to comment.