#include<stdio.h>
#include<stdbool.h>
#include<conio.h>
#include<math.h>
#include<string.h>
void main()
{
int temp, i, j;
temp = 0;
char chars[20];
printf("enter chars : ");
gets(chars);
for(i = 0, j = strlen(chars)-1; i < j; i++, j--)
{
if(chars[i] != chars[j])
{
temp = 1;
break;
}
}
if ( temp == 0)
{
printf("symmetric chain");
}
else
{
printf("not symmetric chain");
}
getch();
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter