Wednesday, 8 January 2014

C Program to Print Alternate Using 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