Wednesday, 8 January 2014

C Program print alternate element of an array

 /*C Program to print alternate element of an array*/
# include<stdio.h>
# include<conio.h>

void main()
{
int arr[10];
int i,j,temp;
clrscr();
for(i=0;i<10;i++)
scanf("%d",&arr[i]);
for(i=0;i<10;i+=2)
printf("%d ",arr[i]) ;
getch();
}

No comments:

Post a Comment