Question: Integers outerInput and innerInput are read from input. The inner while loop executes ( innerInput + 1 ) times for each iteration of the outer

Integers outerInput and innerInput are read from input. The inner while loop executes (innerInput +1) times for each iteration of the outer while loop. Complete the outer while loop to execute (outerInput +1) times.
Ex: If the input is 36, then the output is:#include
using namespace std;
int main(){
int outerInput;
int innerInput;
int count;
int i;
int j;
cin >> outerInput;
cin >> innerInput;
count =0;
i =0;
while (/* Your code goes here */){
j =0;
while (j <= innerInput){
++count;
++j;
}
++i;
}
cout << "Inner loop ran "<< count <<" times" << endl;
return 0;
}

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!