Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

IV. Show the output of following programs. 1) #include <iostream.h> #include <io

ID: 3734310 • Letter: I

Question

IV. Show the output of following programs.

1)

#include <iostream.h>

#include <iomanip.h>

int main ()

{

int c = 0;     

for (int i=0,j= 1; (i <=4 && j <=5); )

{

      c += i+j;

      cout << setw (5) << ++i << setw (5) << c << endl;

}

return 0;

}

____________________________________________________________

#include <iostream.h>

int main ( )

{

int y =0;

   int x =1, total =0;

   while ( x <= 6)

   {

       

     y +=x ;

     cout <<"Y ="<< y <<endl;

     total += y;

     ++x;

    }

cout << "Total is = " << total << endl;

return 0;

}

Explanation / Answer

1)

    1    1
    2    3
    3    6
    4   10
    5   15
  
2)

Y =1
Y =3
Y =6
Y =10
Y =15
Y =21
Total is = 56

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote