Question
This is C++ code I am having a problem to running code I am getting an error so I need help to run the code.
This is C++ code I am having a problem to running code I am getting an error so I need help to run the code.
#include
void CheckValid(vector
}
//checking for rang and duplicates int arr[10] = { 0 }; for (int i = 0; i < size; ++i) { // range check if(numberList[i] > 9 || numberList[i] < 1){ cout << "INVALID : " << numberList[i] << " Exist in list with is out of range "; return; }else{ // dupclicate check arr[numberList[i]]++; if (arr[numberList[i]] == 2) { cout << "INVALID :" << numberList[i] << " Exist more than once in the list "; return;
}
} } //if all is correct then it is valid cout << "List is VALID "; return;
}
//testing + main function int main() { vector
return 0; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started