Answered You can hire a professional tutor to get the answer.

QUESTION

int main ( ) { int data = { 33, 27, 7, 3, 9, 2, 5, 11, 23, 1, 16, 29, 8, 0}; int tmp; for( int i = 0; i lt; data.

int​ ​main​ ​(​ ​)

{

int​ ​data​ ​[]​ ​=​ ​{​ ​33,​ ​27,​ ​7,​ ​3,​ ​9,​ ​2,​ ​5,​ ​11,​ ​23,​ ​1,​ ​16,​ ​29,​ ​8,​ ​0}; int​ ​tmp;

for(​ ​int​ ​i​ ​=​ ​0;​ ​i​ ​<​ ​data.length;​ ​i++) cout​ ​<<​ ​data[i]​ ​<<​ ​"​ ​";

cout​ ​<<​ ​endl;

for​ ​(int​ ​i​ ​=​ ​0;​ ​i​ ​<​ ​data.length-1;​ ​i++)

for​ ​(int​ ​j​ ​=​ ​i+1;​ ​j​ ​<​ ​data.length;​ ​j++)

if​ ​(data[i]​ ​>​ ​data[j])

{

tmp​ ​=​ ​data[i];

data[i]​ ​=​ ​data[j];

data[j]​ ​=​ ​tmp; }

for(​ ​int​ ​i​ ​=​ ​0;​ ​i​ ​<​ ​data.length;​ ​i++) cout​ ​<<​ ​data[i]​ ​<<​ ​"​ ​";

cout​ ​<<​ ​endl;

system​ ​("pause");

return​ ​0;

}

From​ ​the​ ​code​ ​given​ ​for​ ​this​ ​task​ ​above,​ ​use​ ​the​ ​debugging​ ​technique​ ​and​ ​answer​ ​the questions​ ​below:

  1. In​ ​line​ ​7,​ ​what​ ​is​ ​the​ ​output​ ​when​ ​'cout'​ ​has​ ​been​ ​executed​ ​7​ ​times?
  2. In​ ​line​ ​17,​ ​what​ ​is​ ​a​ ​value​ ​of​ ​'tmp'​ ​when​ ​'I'​ ​is​ ​equal​ ​to​ ​5​ ​and​ ​'j'​ ​is​ ​equal​ ​to​ ​8?
  3. In​ ​line​ ​19,​ ​what​ ​is​ ​a​ ​value​ ​of​ ​data[j],​ ​when​ ​it​ ​has​ ​been​ ​executed​ ​for​ ​25​ ​times?

Export​ ​all​ ​the​ ​breakpoints​ ​you​ ​have​ ​created​ ​and​ ​submit​ ​them​ ​with​ ​your​ ​answer.

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question