ok…this may seem stupid but im new to programming and just cant get this palindrome program to run…
#include<stdio.h>
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<string.h>
main()
{
int count=0;
clrscr();
char rev[100];
char str[100];
gets(str);
//int j=0;
cout<<"\n\nInitially the string was :"<<str<<"\n";
cout<<"\n\nAfter Reverse : ";
for(int i=strlen(str)-1,j=0;i>=0,j<strlen(str);i–,j++)
{
cout<<str[i];
rev[j]=str[i];
}
int ptr=strcmp(str,rev);
cout<<ptr;
/*if(ptr==0)
cout<<"\n\n\nPalindrome";
else
cout<<"\n\n\nNot a Palindrome";
/*
for(i=0;i<strlen(str)-1;i++)
{
if(str[i]==rev[i])
count++;
else
break;
}
if(count==strlen(str))
cout<<"\nA Palindrome";
else
cout<<"\nNot a Palindrome";
*/
getch();
}
any suggestions are welcome