adsense

Hii, welcome to my site. My name is Om prakash kartik. This blog helps you to learn programming languages concepts.

Write a program in C to reverse given number

Write a program in C  to reverse given number

#include<stdio.h>
#include<conio.h>
  void main()
   {
   int n,rev=0;
   clrscr();
   printf("Enter a number:-");
   scanf("%d",&n);
   while(n!=0)
     {
      rev=n%10+rev*10;
      n/=10;
      }
      printf("Reverse=%d",rev);
   getch();
   }

Output: 
               

Post a Comment

0 Comments