How many times will the following loop display hello For int

How many times will the following loop display \"hello\"? For (int i= 0; i

Solution

Answer 17:- A(7)

descrition:- compile and run following code

#include <iostream>

using namespace std;

int main()
{
int number=6;
number++;
cout<<number<<endl;


return 0;
}

----------------------------------------------------

Answer 18:- C(21)

descrition:- comple and run this code. it will print HELLO 21 times

#include <iostream>

using namespace std;

int main()
{
for(int i=0;i<=20;i++)
cout << i+1<< \": Hello \" << endl;
return 0;
}

------------------------------------

Answer 19: D(200)

Description:- compile and run this code. it print 200 time message

#include <iostream>

using namespace std;

int main()
{
int count=0;
for(int i=0;i<10;i++)
{
for(int j=0; j<20;j++)
{
cout << ++count<< \": Nice to meet You! \" << endl;
}

}

return 0;
}

-----------------------------------------------

Answer 20:- B(3)

Description :- compile and run this code

#include <iostream>

using namespace std;

int main()
{
int count=0;
for(int i=0;i<10;i++)
{
for(int j=0; j<20;j++)
{
cout << ++count<< \": Nice to meet You! \" << endl;
}

}

return 0;
}

---------------------------------------------------------------------------------------------

If you have any query, please feel free to ask.

Thanks a lot.

 How many times will the following loop display \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site