Write a c program to read n integers from the keyboard and store them in the
array AR. The elements in AR are copied into array OAR and others are
copied into array EAR . Print the values in OAR and EAR. */
# include
# include
void main()
{
int AR[20],OAR[20],EAR[20],n,i,j=0,k=0;
clrscr();
printf("Enter the total number of elements in the array:");
scanf("%d",&n);
for(i=0;i {
printf("Enter the %d element:",i+1);
scanf("%d",&AR[i]);
if((AR[i]%2)==0)
{
EAR[j]=AR[i];
j++;
}
else
{
OAR[k]=AR[i];
k++;
}
}
printf("\nEAR");
for(i=0;i printf("\n%d",EAR[i]);
printf("\n\nOAR");
for(i=0;i printf("\n%d",OAR[i]);
getch();
}
/* Output
Enter the total number of elements in the array:2
Enter the 1 element:1
Enter the 2 element:2
EAR
2
OAR
1*/
array AR. The elements in AR are copied into array OAR and others are
copied into array EAR . Print the values in OAR and EAR. */
# include
# include
void main()
{
int AR[20],OAR[20],EAR[20],n,i,j=0,k=0;
clrscr();
printf("Enter the total number of elements in the array:");
scanf("%d",&n);
for(i=0;i
printf("Enter the %d element:",i+1);
scanf("%d",&AR[i]);
if((AR[i]%2)==0)
{
EAR[j]=AR[i];
j++;
}
else
{
OAR[k]=AR[i];
k++;
}
}
printf("\nEAR");
for(i=0;i
printf("\n\nOAR");
for(i=0;i
getch();
}
/* Output
Enter the total number of elements in the array:2
Enter the 1 element:1
Enter the 2 element:2
EAR
2
OAR
1*/