Answer the question
In order to leave comments, you need to log in
Can anyone explain how this c++ code works?
Here is the code itself:
#include <iostream>
using namespace std;
int main() {
int n;
int s;
n = 0;
s = 0;
while (s <= 257) {
s = s + 10;
n = n + 3;
}
cout << n <<endl;
system("pause");
return 0;
}
Answer the question
In order to leave comments, you need to log in
And what exactly is unclear here? It says to loop while s is less than or equal to 257 .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question