hi guys , what i am trying to do is ,to take a word as
input from user and reverse its order like world
into dlrow and tell the user that the word is same or not after reversing its order
Here is the code please check it cause it is not working
#include<stdio.h>
#include<conio.h>
void main()
{
char name[10]={0,0,0,0,0,0,0,0,0,0};
char namre[10]={0,0,0,0,0,0,0,0,0,0};
int i=0,a=0,j,q=0,num=0;
clrscr();
printf("Please Enter The Number Of Leters In Your Word");
scanf("%d",&num);
printf("enter\n");
for(i=0;i<num;i++)
{
name[i]=getche();
a++;
}
printf("\n");
q=a;
for(j=0;j<a;j++)
{
q--;
namre[q]=name[j];
if(namre[q]==name[j])
{
printf("the word is same");
break;
}
else
{
printf("the word is not same");
break;
}
}
getch();
}