write a program to read and store 10 values from the user th
write a program to read and store 10 values from the user ,the positive value are to be stored at even indices where the negative values will be store in in odd indices , and display the array .
Solution
#include<stdio.h>
#include<conio.h>
void main()
{
int *array,number,j;
clrscr();
printf(\"Enter The Number Of Elements :\");
scanf(\"%d\",&number);
array=(int *)malloc(number*2);
printf(\"Enter The numbers :\");
for(j=0;j<number;j++) scanf(\"%d\",(array+j));
printf(\"nPositive Numbers Are....n\");
for(j=0;j<number;j++) if(array[j]>0) printf(\" %d\",array[j]);
printf(\"nNegative Numbers Are....n\");
for(j=0;j<number;j++) if(array[j]<0) printf(\" %d\",array[j]);
getch();
}
