Question

Question 4 20 pts Go to the full description for No.42 Consider the following code. Show the expected result of this program

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Output:

Ref1 10 num1 10 num2 20

Tunu num2

Note : Please comment below if you have concerns. I am here to help you

If you like my answer please rate and help me it is very Imp for me

Add a comment
Know the answer?
Add Answer to:
Question 4 20 pts Go to the full description for No.42 Consider the following code. Show...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • IV. Function Tracing (20 points) Trace the following program. Show llof your work and the ound...

    IV. Function Tracing (20 points) Trace the following program. Show llof your work and the ound he output in the work including labeled boxes for user-defined functions, calculations, and the output in designated spaces. You should draw a box for each variable and show value updates d the output, Show all of your #include <iostream» using namespace std; void mickey (int sa, int b, int &c) void minnie(int u, int &v, int w); void pluto (int m, int n, int...

  • Fix this code so only the function prototype comes before main. #include <iostream> using namespace std;...

    Fix this code so only the function prototype comes before main. #include <iostream> using namespace std; bool isMultiple(int num1, int num2) { return num1 % num2 == 0; } int main() { char ch = 'Y'; int num1, num2; while(ch =='Y') // While ch is equal to Y { cout << "Enter two numbers(largest first): "; cin >> num1; // Getting 1st number cin >> num2; // Getting 2nd number if(isMultiple(num1, num2)) cout << num2 << " " << "IS...

  • KINDLY HELP SOLVE THE C++ SECURE SHELL DRILLS, RUN AND COMPILE THEM TO PERFORM THE TASK PERFECTLY...

    KINDLY HELP SOLVE THE C++ SECURE SHELL DRILLS, RUN AND COMPILE THEM TO PERFORM THE TASK PERFECTLY. THANK YOU. /1 Function: Complete the body of the Read _Kth Num function. #include <iostream> using namespace std; // Read the k'th input value. DO NOT ISSUE A PROMPT // Example: when 3 and inputs are 4 6 8 10 12 the desired value is 8 void Read Kth Num (int k, int & value) tinclude "mainpt60300a.cpp" //Function: Complete the MaxVal function #include...

  • (F) Specify the errors of the following code? 1) #include <iostrem> o stream 2) using namespace...

    (F) Specify the errors of the following code? 1) #include <iostrem> o stream 2) using namespace std; 3) int min() main 4) { 5) double num1 = 5, num2, sum; 6) num2 = 12; 7) sum = numl + num2, 8) cout << "The sum is ">> sum; 9) retrn 0; return 10)}

  • C++ problem where should I do overflow part? in this code do not write a new...

    C++ problem where should I do overflow part? in this code do not write a new code for me please /////////////////// // this program read two number from the user // and display the sum of the number #include <iostream> #include <string> using namespace std; const int MAX_DIGITS = 10; //10 digits void input_number(char num[MAX_DIGITS]); void output_number(char num[MAX_DIGITS]); void add(char num1[MAX_DIGITS], char num2[MAX_DIGITS], char result[MAX_DIGITS], int &base); int main() { // declare the array = {'0'} char num1[MAX_DIGITS] ={'0'}; char...

  • So the assignment is to write a program that have the user entered 3 numbers and...

    So the assignment is to write a program that have the user entered 3 numbers and than it will sort it by ascending order. Here are the code I wrote, but it won't compiled and I kept on getting an error message "Using uninitiazed memory" for all the variables. Can someone please help take a look and see whats going on? #include <iostream> using namespace std; int main() { //variables int num1, num2, num3; int lowest, middle, highest; //user inputs...

  • This is a fill in the code type: // FILL IN THE CODE - Write a...

    This is a fill in the code type: // FILL IN THE CODE - Write a program to multiply 2 numbers, print out the results and print out the original numbers in ascending order. #include <iostream> using namespace std; int main() {   int num1;       // holds 1st number   int num2;       // holds 2nd number   int result;       // holds result of multiplication   int *num1Ptr = nullptr; // int pointer which will be set to point to the 1st number   int *num2Ptr...

  • 4. (10 pts) Show the output of the following program: (list the program outputs in the...

    4. (10 pts) Show the output of the following program: (list the program outputs in the order as they would appear on screen) #include <iostream> using namespace std; int Mystery(int); int main() int x=2, y: y=Mystery(x - 1)+1; cout << "x="«x«", y="«y < endl; y=Mystery( 2 *x); cout << "x="«x«", y="«y < endl; return 0; int Mystery (int num) int y=5; // This is a regular local variable, not a static local variable int result; y=y+num; cout << "y=" <y<",...

  • NEED ASAP PLEASE HELP Task: --------------------------------------------------------------------------------------...

    NEED ASAP PLEASE HELP Task: --------------------------------------------------------------------------------------------------------------------------------- Tasks to complete: ---------------------------------------------------------------------------------------------------------------------------------------- given code: ----------------------------------------------------------------------------------------------------------------------------------------------- main.cpp #include <iostream> #include <iomanip> #include "fractionType.h" using namespace std; int main() { fractionType num1(5, 6); fractionType num2; fractionType num3; cout << fixed; cout << showpoint; cout << setprecision(2); cout << "Num1 = " << num1 << endl; cout << "Num2 = " << num2 << endl; cout << "Enter the fraction in the form a / b: "; cin >> num2; cout << endl; cout <<...

  • May i ask for help with this c++ problem? this is the code i have for assignment 4 question 2: #...

    may i ask for help with this c++ problem? this is the code i have for assignment 4 question 2: #include<iostream> #include<string> #include<sstream> #include<stack> using namespace std; int main() { string inputStr; stack <int> numberStack; cout<<"Enter your expression::"; getline(cin,inputStr); int len=inputStr.length(); stringstream inputStream(inputStr); string word; int val,num1,num2; while (inputStream >> word) { //cout << word << endl; if(word[0] != '+'&& word[0] != '-' && word[0] != '*') { val=stoi(word); numberStack.push(val); // cout<<"Val:"<<val<<endl; } else if(word[0]=='+') { num1=numberStack.top(); numberStack.pop(); num2=numberStack.top(); numberStack.pop();...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT