Coding Now – Best AI & Full Stack Courses in Delhi NCR | 100% Placement
Limited Offer: Get 50% OFF on AI & Full Stack Courses
📞 Call Now: +91 9667708830
Home Community WACP to reverse the digits of a number using while loop.

WACP to reverse the digits of a number using while loop.

Soham  •  Jul 21, 2026  •  2 views
0

1 Answers

Soham
Jul 21, 2026
#include<stdio.h>
int main(){
int i,rem,rev=0;
printf("Enter Number: ");
scanf("%d",&i);
while(i!=0){
rem=i%10;
rev=rev*10+rem;
i=i/10;

}
printf("%d",rev);
return 0;
}

Your Answer

Will not be displayed publicly
💬 Talk to Advisor
1
WhatsApp

Latest from Our Blog

Insights on AI, Data Science, Full Stack & Career

View All Articles →