#include <stdio.h>
#define MAX 50
int main () {
  int arr[MAX], i, num;
  printf("Enter size of array: ");
  scanf("%d", &num);
  printf("\nEnter %d elements of array: ", num );
  for (i=0; i<=num; i++) {
    scanf("%d ", &arr[i]);
  }
  printf("\n\neven numebrs: ");
  for (i=0; i<=num; i++) {
    if (arr[i]%2==0) {
      printf("%d ", arr[i]);
    }
  }
  printf("\nodd numbers: ");
  for (i=0; i<=num; i++) {
    if (arr[i]%2!=0) {
      printf("%d ", arr[i]);
    }
  }
}



—-
guys, i input 3 first, then i have to input that much element. but the problem is that the code isreding as if i should input 5 elements of array, how can i input the exact array's inputed element number?