GoogelAddUnit1

Thursday 10 March 2011

C Program to Calculate the Unique Number.


/* unique number */                                                                                


#include<stdio.h>
#include<conio.h>
main()
{
   int n,d,rev=0,k;
   printf("\n enter the value ");
   scanf("%d",&n);
   k=n;
   while(n!=0)
   {
     d=n%10;
     rev=(rev*10)+d;
     n=n/10;
   }
   printf("\n  %d",rev);
   if(k==(rev*9))
     printf("\n given no is unique");
   else
     printf("\n given is not unique");
     getch();
}

No comments:

Post a Comment