// @Author: Subodh
// 1 liner solution
(num & 1) ? cout << num << " is odd" : cout << num << " is even" << endl;
#include<stdio.h>
int isEven(int);
int main(void) {
int n, x, a;
int array[n];
printf("Enter n: ");
scanf("%d", &n);
int elem[n];
for(x=0; x<n; x++){
printf("Enter value #%d: ", x+1);
scanf("%d", &elem[x]);
a = elem[x];
if(isEven(a))
printf("%d is even
",a);
else
printf("%d is odd
",a);
}
return 0;
}
int isEven(int n) {
return n % 2 == 0;
}