0
WHY NOT WORKING?
#include <iostream> using namespace std; int main() { int a = 1; while (a > 278) { cout << a; a = a + 5; } }
4 Respuestas
+ 4
"a" equals 1 so there is no way it will ever be greater than 278.
the while loop will not execute and the main will terminate.
+ 3
a=a+5; doesn't happen because is inside the while loop that will not run as it checks a to be greater than 278.
to do what you want to do you probably have to change line 5 like this:
while(a<278){
this way the wile loop will execute continously until the value of a increases above 278 and the program will terminate.
+ 1
I understood. Thank you very much.
0
But in fact in a cycle there is a = a + 5