Asked in
Computers
C Programming

Flowchart of a c program to reverse a number?

Answer

User Avatar
Wiki User
March 10, 2011 4:39PM

#include<stdio.h>

#include<conio.h>

void main()

{

clrscr();

int r=0,d,m,n;

printf("Enter a value=");

scanf("%d",&n);

m=n;

do

{

d=m%10;

m=m/10;

r=(r*10)+d;

}

while(m!=0);

printf("%d is the reverse",r);

getch();

}