#include <stdio.h>
int main()
{
int i,s,n,a[100];
printf("\nEnter the Limit : ");
scanf(" %d", &n);
printf("\nEnter the numbers :");
for(i=0; i<n; i++)
{
scanf(" %d", &a[i]);
}
for(i=0; i<n; i=i+2)
{
s=a[i];
a[i] = a[i+1];
a[i+1]= s;
}
for(i=0; i<n; i++)
{
printf("\n%d", a[i]);
}
}
Comments
Post a Comment