Explore
ProGrad Programs
About Us

Edit
Reply




Edit

Program to find the array type (even, odd or mixed array) | FACE Prep

Published on 11 Mar 2020

Program to find the array type (odd, even or mixed array) is discussed here. Given an array of integers, display the type of the array.


Input format:


  • Input consists of 1 integer and 1 array.
  • Integer corresponds to the size of an array.


Sample Input:


5

2

4

1

3

5


Sample output:


Mixed


Algorithm to find the array type (even, odd or mixed array)


  • Input the number of elements of the array.
  • Input the array elements.
  • If all the elements of the array are odd, display "Odd".
  • If all the elements of the array are even, display "Even".
  • Else, display "Mixed".


Program to find the array type (even, odd or mixed array)


C
C++
Java
Python 3

Output
5
1 2 3 4 5
Mixed


Recommended Programs





If you have any feedback about this article and want to improve this, please write to enquiry@faceprep.in