Computer Science, asked by arnavkarmankar60, 1 year ago

Write a program to accept a number from the user and reverse it. Do While Loop

Answers

Answered by Anonymous
0

C Program to reverse digits of a number using do while loop///


#include<stdio.h>

#include<conio.h>

void main()

{

 int num;

 int rev=0, rem=0;

 printf("\n Enter a number: ");

 scanf("%d",&num);

 do

 {

   rem = num%10;

   rev = rev*10+rem;

   num = num/10;

 }while(num>0);

 printf("\n reverse number = %d",rev);

 getch();

}

Similar questions