Sunday 8 April 2012

10).Find The Reverse Of A Given Number.

#include<conio.h>
#include<iostream.h>

void main()
{
 clrscr();

  int a, r=0 ,N;
      cout<<"Enter The Number ";
      cin>>N;
      while(N>=1)
      {
          a=N%10;
          r=r*10+a;
          N=N/10;
      }
      cout<<"Reverse of The Number is "<<r;
       getch();

}

No comments:

Post a Comment

Write a program which reads a set of integers into an integer array and then prints "YES"if all of them are same otherwise print "NO".

#include<stdio.h> int main() { int a[10],M=0,i,n; printf("enter a value for n\n"); scanf("%d",&n); fo...