my confusion is that how in the program the number of positive and negative numbers are calculated by writing that piece of code shown. explain these code please!
int num[5], i, neg = 0, pos = 0;
printf("enter any 5 numbers");
for (i = 0; i <= 4; i++)
scanf("%d", &num[i]);
for (i = 0; i <= 4; i++) {
num[i] < 0 ? neg++ : (pos++);
}
printf("\nnegative elements=%d", neg);
printf("\npositive elements=%d", pos);
getch();