HOME

Sunday, May 3, 2015

C PROGRAM TO REVERSE THE NUMBER

#include<stdio.h>
#include<conio.h>
void main()
{
    int n,rem,rev=0;
    printf("enter the number\n");
    scanf("%d",&n);
    while(n>0)
    {
        rem=n%10;
        rev=rev*10+rem;
        n=n/10;
    }
    printf("the reverse of the number is %d",rev);
}

No comments:

Post a Comment