I am working on solving a mathematical problem.
What I am trying to do is to have an if statement that compares variable n to a set of variables i 1 through 10. Is there any way to do it in c++?
here is what I am trying to do:
int smallPos(int n){
if (n%for(int i=1;i<=10;i++)==0) {
return n;
}
This is obviously wrong but is any way to get around it?
What you want to do is this: