Skip to content

Commit

Permalink
the number you enter will be reversed
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidddharthh committed Oct 31, 2019
1 parent 138e8b1 commit 556e67e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions reverse.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include<stdio.h>

int main() {
int num,rem,rev = 0;

printf("\n Enter any no to be reversed ");
scanf("%d", &num);

while (num >= 1) {
rem = num % 10;
rev = rev * 10 + rem;
num = num / 10;
}

printf("\n Reversed Number : %d", rev);
return (0);
}

0 comments on commit 556e67e

Please sign in to comment.