#include "Oddities.hpp"
#include <iostream>
usingnamespace std;
int main()
{
cout << "Input number of values : ";
int num;
cin >> num;
int counter = 0;
int i;
while (counter < num) {
cin >> i;
if (i % 2 == 0)
{
cout << num << " Is even ";
}
else {
cout << num << " is odd ";
}
counter++;
}
return 0;
}
Also, another issue i have is that when i create and use a new file to make a program (in Xcode) i'll get the "build failed" error both when running the new program (in the other file) and the old program, even though the old program worked previously.
It may not be working for you because you aren't flushing the output. Also, you aren't prompting for the individual values, so it maybe waiting for input without you knowing about it.
Also, use consistent indenting.
#include <iostream>