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

Write the OUTPUT as it would appear on the screen include using namespace std; v

ID: 3779970 • Letter: W

Question

Write the OUTPUT as it would appear on the screen include using namespace std; void xyz(int &, int &, int &); int main() {int side1 = 1, side2 = 2, prod = 0; xyz(side1, side2, prod); cout nestedlessless " side1=" nestedlessless side1 nestedlessless" side2 ="nestedlessless side2 nestedlessless" prod "nestedlessless prod nestedlessless endl; return 0;} void xyz(int &a;, int &b;, int &c;) {a = a*a*a; b = b*b*b; c = a * b;} Write OUTPUT as it would appear on the screen #include using namespace std; int main() {int num = 0, *amount = NULL; amount = # *amount = 24; coutnestedlesslessnum; *amount = *amount + 2; cout nestedlessless *amount; cout nestedlessless num; system("pause"); return 0;}

Explanation / Answer

1)

#include <iostream>
using namespace std;
void xyz(int &, int &, int &);

int main() {
   int side1=1, side2=2,prod=0;
   xyz(side1,side2,prod);
   cout <<"side1=" <<side1<<"side2="<<side2<<"prod" <<prod<<endl;
  
   return 0;
}
void xyz(int &a, int &b, int &c)
{
a=a*a*a;
b=b*b*b;
c=a*b;
}

OUTPUT:

the exact output will be:

side1=1side2=8prod8

which means the side1=1, side2=8, prod=8

Explain: the values of side1,side2 and prod is passing to function to calculate the values side1 and side2 is calculated as cube of currosponding values and prod is calculated as product of side1 and product of side2.

2)

#include <iostream>
using namespace std;
void xyz(int &, int &, int &);

int main() {
   int num=0, *amount=NULL;
   amount=&num;
   *amount=24;
   cout<<num;
   *amount=*amount+2;
   cout <<num;
   system("pause");
   return 0;
}

OUTPUT:

2426

that means first it will print 24 and then 26.

Explaination: first it will print the value of num then print amount value after increased by 2 .

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote