+ 2
Don't Work if i replace < with =
hello if i replace the while (num < 6) with while (num = 6) the Program don't stopt. why? #include <iostream> using namespace std; int main() { int num = 1; while (num < 6) { cout << "Number: " << num << endl; num = num + 1; } return 0; }
1 Respuesta
+ 8
I think it should be ==
= is assigning a value while == is comparing values