DO NOT MISS

Ads

Tuesday, 2 August 2016

Program 19 Using While loop



#include<stdio.h> 
#include<conio.h> 

void main() 

     { 

            int rev=0,r,n; 
            clrscr(); 

            printf("enter a number:"); 
            scanf("%d",&n); 

            while(n!=0) 

                  { 
                          r=n%10; 
                          rev=rev*10+r; 
                          n=n/10; 
                  } 

                          printf("the revers of the no. is:=%d\n",rev); 

            getch(); 

     }

Output:-

______________________________________________________
______________________________________________________
______________________________________________________
_____________________________________________________




Greataims

 
Copyright © 2016 Computersadda. Designed by @ Computersadda Team - Published By Greataims