Saturday 25 May 2013

0 A C - PROGRAM TO FIND WHETHER A NUMBER IS PALINDROME OR NOT.

PALINDROME  
 A palindrome is a word, phrase, number, or other sequence of symbols or elements, whose meaning may be interpreted the same way in either forward or reverse direction.


                                                           THE PROGRAM IS :
#include<stdio.h>
#include<conio.h>
void main()
{
 int m,n,gcd,lcm,rem,p,q;
 printf("enter the no m and n \n");
 scanf("%d%d",&m,&n);
 p=m;
 q=n;
 while(n!=0)
 {
     rem=m%n;
     m=n;
     n=rem;
}
  gcd=m;
  printf("\n gcd of %d and %d is = %d\n",p,q,gcd);
  lcm=(p*q)/gcd;
  printf("\n lcm of %d and %d is = %d\n",p,q,lcm);
getch();
}


Just copy and paste into your Microsoft Visual C++ or Turbo C (these are program developing software)
Or else you can try this demo file and use it to find whether a number is palindrome or not ...
Click HERE to download this file.

~NOTE~ : While executing if you get any warning then just ignore it and continue with your program...




IF FACE ANY PROBLEM DON'T FORGET TO COMMENT ...!!

Don't Forget to share.... 

Follow on Facebook : Ethical Hacking.

No comments:

Post a Comment