c++
Convert the following for loop to a while loop:
for (int x = 50; x > 0; x-=2)
{
cout << x << " seconds to go.\n";
}
int x = 50; while (x > 0) { cout << x << " seconds to go.\n"; x -= 2; }
#include <iostream> using namespace std; int main() { int x = 50; while (x > 0) { cout << x << " seconds to go.\n"; x -= 2; } return 0; }
Get Answers For Free
Most questions answered within 1 hours.