• Now Online : 67
  • admin@codemyne.net

Introduction

The program shows the reverse of a number. For example take the number as 6735, the reverse of the number shows 5376 as output.

#include<stdio.h>
#include<conio.h>
void main()
{
    int num,r,reverse=0;
    printf("/n Enter any number:");
    scanf("%d",&num);
    while(num)
    {
        r=num%10;
        reverse=reverse*10+r;
        num=num/10;
    }
    printf("Reverse of a number %d",reverse);
                                            return 0;
}

Comments/Suggestions are invited. Happy coding......!

Comments Post a Comment

Reba Dutta 8/22/2012 (IST) / Reply

Absolutely right logic has been implemented