I'm creating a computerized version of a sort of game that maths teachers play with the class sometimes, but I have a prob. This section of the code checks whether 3 is a factor of the 'count' integer and whether 5 is a factor if it, but when it is executed, the program only reacts (by changing the contents of a child control) when it is a factor of 5 and not when it is a facor of 3. Whats wrong?
ThanksCode:div_test = count % 3; if(div_test == 0) { SetDlgItemText(hDlg, IDC_RESPONSE, "Factor of three"); } div_test = count % 5; if(div_test == 0) { SetDlgItemText(hDlg, IDC_RESPONSE, "Factor of five"); } else { itoa(count, count_str, 10); SetDlgItemText(hDlg, IDC_RESPONSE, count_str); }



LinkBack URL
About LinkBacks



Have a nice day.
