-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc38.c
More file actions
40 lines (38 loc) · 686 Bytes
/
c38.c
File metadata and controls
40 lines (38 loc) · 686 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//palindrome array
#include<stdio.h>
int main()
{
int a[5]={1,2,3,2,1},isp=1;
for(int i=0,j=4;i<5;i++,j--)
{
if(a[i]!=a[j])
{
isp=0;
break;
}
}
if(isp==0)
{
printf(" not palindrome");
}
else
{
printf("palindrome");
}
}
/*#include<stdio.h>
int main()
{
int a[7];int i,j;
printf("array elements");
for( j=0;j<7;j++)
scanf("%d",&a[j]);
for( i=0;i<3;i++)
if(a[i]!=a[7-i-1])
break;
if(i<3)
printf("array not palindromic");
else
printf("array is palindromic");
return 0;
} */