4.5.3: All values fit a category?
Challenge Activity
Declare a Boolean variable named allEqual. Read in an input value for the variable valCount. Then, read valCount integers from input and output "All equal 1" if all integers are equal to 1. Otherwise, output "Some values are not 1".
Ex: If the input is 3 1 1 1, the output is:
All equal 1
/* Additional variable declarations go here */
bool allEqual;
cin >> valCount;
/* Your code goes here */
for (int i=0; i< valCount; i++) {
}
if (allEqual) {
cout << "All equal 1" << endl;
} else {
cout << "Some values are not 1" << endl;
}