Q.5) Answer the following: Consider the following declaration: b) What is the output after the following statements executes? int i, list[6]: for (i = 0; i


Q.5) Answer the following:<br>Consider the following declaration:<br>b) What is the output after the following statements<br>executes?<br>int i, list[6]:<br>for (i = 0; i< 6; i++)<br>{ list[i] =3+2*i;<br>if (i%3==0)<br>а)<br>int beta [3][3]:<br>What is stored in beta after the following<br>statements executes?<br>int i, j:<br>for ( i=0; i<=2; i++)<br>for ( j=0; j<=2; j++)<br>betali][j] = 2* (i+j) % 4;<br>list[i]=listfi]+i;<br>cout<<setfill('@')<<setw(4)<<list[i];<br>c) Consider the following function:<br>int secret(int one)<br>d) What is the output of the statement?<br>listElement (list, 6);<br>when int list[6]={23,14,3,-6,36,85};<br>and the function listElement is:<br>int i;<br>int prod = 1;<br>for (i 1; i<= 3; i++)<br>prod prod * one;<br>return prod;<br>void listElement (int x[ ], int Z)<br>int i;<br>What is the output of the following C++ statements?<br>1- cout<<secret(5)<<endl;<br>2- cout<<2*secret(6)<<endl;<br>for (i= 0; i < Z; i++)<br>{ x[i]=x[Z-i-1]-pow(i,2.0);<br>cout<<x[i]<<

Extracted text: Q.5) Answer the following: Consider the following declaration: b) What is the output after the following statements executes? int i, list[6]: for (i = 0; i< 6;="" i++)="" {="" list[i]="3+2*i;" if="" (i%3="=0)" а)="" int="" beta="" [3][3]:="" what="" is="" stored="" in="" beta="" after="" the="" following="" statements="" executes?="" int="" i,="" j:="" for="" (="" i="0;"><=2; i++)="" for="" (="" j="0;"><=2; j++)="" betali][j]="2*" (i+j)="" %="" 4;="" list[i]="listfi]+i;"><><><= 3;="" i++)="" prod="" prod="" *="" one;="" return="" prod;="" void="" listelement="" (int="" x[="" ],="" int="" z)="" int="" i;="" what="" is="" the="" output="" of="" the="" following="" c++="" statements?="" 1-=""><><>< z;="" i++)="" {="" x[i]="x[Z-i-1]-pow(i,2.0);"><><" ";="">

Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here