0
Again, help please đ
7 Answers
+ 2
printf("Enter the five digit number: \n");
scanf("%d", &n);
while(n>0){
int rem=n%10;
revnum=revnum*10 + rem;
n=n/10;
}
printf("The reversed number is: ");
printf("%d",revnum);
return 0;
+ 1
Ira Sarkar you didn't told us that you have to solve it without loop.
hopefully you got the answer tho.
+ 1
Ira Sarkar now that you have solved it with inline code, you might enjoy seeing another approach. Here is a way to use recursion to print the number from right to left without using a loop:
https://code.sololearn.com/ccK0p8BIKAaS/?ref=app
+ 1
Brian yes, thank you.đ
0
Abhay i have got to solve it without loopđ
0
Abhay but I found my answer, I think, not sure.
Let me tryđ
0
Abhay yesđ
I got it, thanks a lot though!