Question: . Use the 3 nested FOR loops that tell time (we did in class). 2. Take this C++ program and change the 3 nested FOR

. Use the 3 nested FOR loops that tell time (we did in class).

2. Take this C++ program and change the 3 nested FOR loops and replace them with 3 nested WHILE loops.

3. The program should work exactly the same.

#include using namespace std;

int main() { int h,m,s; cout << "Looping through all of the seconds in a day. /n ";

for (h = 0; h <= 10; h++) { for (m = 0; m <= 60; m++) for (s = 0; s <= 60; s++) { printf("%2d : %2d ", h, m, s); } }

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!