Saturday, 24 December 2016

//PALINDROME: sequence that reads the same backwards as forwards.
//THIS PROGRAM HELP TO UNDERSTAND HOW PALINDROME WORKS.

#include<stdio.h>
#include<conio.h>
void main()
{
char one[10],two[10];
int cmp;
 printf("enter the string:");
scanf("%s",one);
strcpy(two,one); //strcpy use to copy one to two
strrev(one); //strrev is used to reverse the string
cmp=strcmp(one,two); /*strcmp used to compair the two string*/
if (cmp==0)
{
printf("entered string is palindrome");
    }
    else
    {
    printf("string is not palindrome");
}
getch();


}
//THIS IS MY FIRST AND EASIEST PROGRAM PROGRAM
//FACTORIAL OF SMALL NUMBER

#include<stdio.h>
#include<conio.h>
int main()
{
int fact=1,no,i;    //
printf("enter the no");
scanf("%d",&no);
for(i=no;i>=1;i--)
{
fact=fact*i;
}
printf("fact is %d",fact);
getch();


}