Skip to content

Commit

Permalink
Reverse a 5 digit number
Browse files Browse the repository at this point in the history
  • Loading branch information
KeerthanaPravallika authored May 25, 2021
1 parent 232e85b commit 1a93130
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Reverse a 5 digit Number
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <stdio.h>

int main()
{
long n,reverseNum;
int d;
printf("Enter the number : ");
scanf("%ld",&n);
while(n!=0)
{
d = n%10;
reverseNum = reverseNum*10 + d;
n = n/10;
}
printf("Reveresed Number is %ld",reverseNum);

return 0;
}

0 comments on commit 1a93130

Please sign in to comment.