[Solved] C++ Check if number is even or odd


#include "stdafx.h"
#include <iostream>

using namespace std;

int main()
{
  system("color f0");
  int n = 0, A[1337];
  cout << "Enter number of array members: " << endl;
  cin >> n;
  //Make sure n is not bigger than your arrays
  if( n > 1337 )  n=1337;
  cout << "Enter numbers : \n";
  for (int i = 0; i < n; i++)
    cin >> A[i];

  for (int i = 0; i < n; i++)
  {
    if( A[i] == 0 )
    {
      cout  << A[i] << " is 0" << endl;
    }
    else
    {
      cout << A[i] << " " << (A[i] < 0? "n": "p") << (A[i]%2? "p":"n"); 
    }

  }
  cout << endl;
  system("pause");
  return 0;
}

solved C++ Check if number is even or odd