#include <stdio.h>
// 12 34 45 56 67 7 8 78 87 54 12
int main()
{
int num[]={1,2,3,4,5,6,7,8,9,10};
int i,t;
printf("\n Before Interchange \n");
for(i=0;i<=9;i++)
{
printf("%d\n", num[i]);
}
for(i=0;i<=9;i=i+2)
{
t=num[i]; //i=0
num[i]=num[i+1];
num[i+1] = t ;
}
printf("\n After Interchange ");
for(i=0;i<=9;i++)
printf("\n%d",num[i]);
return 0;
}
Comments
Post a Comment