#define SWAP(a,b) a^=b^=a^=b
int string[100];
int m;
void Replace(int n,int start){
int i,j;
for(i=start,j=0;j
SWAP(string[i],string[n+i]);
}
n=n-1;
if(n>0)
Replace(n,start+1);
}
main()
{
int i;
printf("Enter no of elements (max 100): ");
scanf("%d",&m);
if(m%2){
printf("odd nos\n");
}
else{
printf("Enter numbers: ");
for(i=0;i
for(i=0;i
printf("\n");
Replace(m/2-1,1);
for(i=0;i
printf("\n");
}
}
No comments :
Post a Comment