11 In this exercise you will modify the code from Exercise 1

11. In this exercise, you will modify the code from Exercise 10. If necessary, create a new project named ModifyThis11 Project, and save it in the Cpp81Chap08 folder. Enter (or copy) the TryThis10.cpp instructions into a new source file named ModifyThisl1.cpp Change TryThis10.cpp in the first comment to ModifyThis11.cpp. Replace the while and do while statements with for statements. Save and then run the program

Solution

#include <iostream>
using namespace std;
int main()
{
   for(int row=5;row>0;row=row-1)
   {
       for(int col=1;col<=row;col+=1)
           cout<<\'*\';
       cout<<endl;
   }

   return 0;
}

 11. In this exercise, you will modify the code from Exercise 10. If necessary, create a new project named ModifyThis11 Project, and save it in the Cpp81Chap08

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site