I am a grader for a C++ class. My skills in the more advanced concepts are pretty lacking overall due to lack of practice, so I am not familiar with the ins-and-outs of the language. My question is about a block of code with an unusual line in an assignment about dice rolls.
#include <iostream>
using namespace std;
int main()
{
int numSims = numSims % 12 == 0 || numSims > 1000;
//Other irrelevant code follows
}
I can't find anything saying this is bad syntax. I can't see why a student would want to do this when this kind of statement, as far as I know, can't execute. Is there a hidden secret here than I'm missing?