Saturday, 30 December 2017

C program to reverse any number

#include<stdio.h>

int main( )

{
    int n, i, rev=0;
    
    printf("Enter the number");
    scanf("%d",&n);

    while(n>0)

     {
            i=n%10;
            n=n/10;
            rev=rev*10+i;
     }
     
    printf("reverse number is %d", rev);

 return 0;

}



No comments:

Post a Comment

Featured Post

TCS Latest Test Patern ( For On-Campus Drives )

Tata Consultancy Services is software services consulting company whose  headquarter is situated in Mumbai, India. It is the Asia’s larges...