Question

Please answer in plain text. Determine the C++ output for the following: Assume: int num1 =...

Please answer in plain text.

  1. Determine the C++ output for the following:

Assume: int num1 = 25,   num2 = 5,   num3 = 10;

        

a.    cout<< “ The product is “ << num1 * num3;

       

        ________________________________________________________

b.     cout<< “ The total of the three numbers is: “ <<(num1+num2+num3);

         ________________________________________________________

c.     cout<< “ The total is: “ <<(num1+254.3373);

       

        _________________________________________________________

d.     cout << num1 << “ +  “    << num2 << “ = ” << num1 + num2;

     

         _________________________________________________________

e.    cout << “ This is how the output should look  | “ << (num1- num3)<< “|”;  

            

_________________________________________________________

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

a. Output: The product is 250

  • num1*num3 = 25*10 = 250

b. Output: The total of the three numbers is: 40

  • num1+num2+num3 = 25+5+10 = 40

c. Output: The total is: 279.337

  • num1+254.3373 = 25+254.3373 = 279.337

d. Output: 25 + 5 = 30

e. Output:  This is how the output should look  | 15|

  • num1-num2 = 25-10 = 10
Add a comment
Know the answer?
Add Answer to:
Please answer in plain text. Determine the C++ output for the following: Assume: int num1 =...
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
  • c++ 3- What is the output of the following pseudocode, where num1 , num2 , and...

    c++ 3- What is the output of the following pseudocode, where num1 , num2 , and num3 are integer variables? num1 = 5 num2 = 1 num3 = 4 aQueue.enqueue(num2) aQueue.enqueue(num3) aQueue.dequeue() aQueue.enqueue(num1 - num2) num1 = aQueue.peek() aQueue.dequeue() num2 = aQueue.peek() aQueue.dequeue() cout << num2 << " " << num1 << " " << num3 << endl

  • I couldn't find where to comment. But it has to be written in C++!!!!! Task-1: Rational...

    I couldn't find where to comment. But it has to be written in C++!!!!! Task-1: Rational fractions are of the form a / b, in which a and b are integers and ! ≠ 0. In this exercise, by ‘‘fractions’’ we mean rational fractions. Suppose a / b and c / d are fractions. Arithmetic operations and relational operations on fractions are defined by the following rules: Arithmetic Operations: a/b + c/d = (ad + bc)/bd a/b – c/d =...

  • Please help me solve the following. Thank you in advance :) Answer the following five questions...

    Please help me solve the following. Thank you in advance :) Answer the following five questions related to code output (Q2 i through m) What is the output of the following C+ coaer int numl; int num2; int *p = &num1 ; p = &num2 ; *p 25; num1 num2 + 6; p = &num! ; num2 = 73; *p = 47; cout << *p << " "<< numl <<""<< num2 << endl; What is the output of the following...

  • 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 <<...

  • java question, my questions are in the following codes with comments, just answer next or under...

    java question, my questions are in the following codes with comments, just answer next or under it thanks! theres only few, so no worry. import java.security.SecureRandom; public class clsTestRand {    public static void main(String[] args) {        // TODO Auto-generated method stub        //int num1, num2, num3, num4, num5, num6;        int num1 = 0;        int num2 = 0;        int num3 = 0;        int num4 = 0;        int...

  • Assignment #1: Write a C++ Program. Consider the following program segment. // Name: Your Name //...

    Assignment #1: Write a C++ Program. Consider the following program segment. // Name: Your Name // MU ID: Your ID // include statement (s) l using namespace statement int main() //variable declaration //executable statements // return statement a. Include the header files isotream. b. Include cin, cout, and endl. c. Declare two variables: numi, num2, num3, and average of type int. d. Assign 125 into numi, 28 into num2, and -25 into num3 e. Store the average of numi, num2,...

  • What are the errors in the following code? My professor gave us this prewritten code and...

    What are the errors in the following code? My professor gave us this prewritten code and asked us to find the errors in it so that it can run properly #include <cstdlib> #include <ctime> #include <iostream> using namespace std; // input: integer // output: none // adds five to the given parameter void addFive( int x ) { x += 5; } // input: none // output: a random number int generateRandomNumber() { srand( time(0) ); return rand() % 100;...

  • Question b and c please! 5. (18 points, 3 each) Answer the questions about this data...

    Question b and c please! 5. (18 points, 3 each) Answer the questions about this data segment. Remember that .data starts at Ox10010000. Show the data and address values as 8 hexadecimal numbers (such as Ox00000000). .data num1: .word 7, 4 num2: .word 9 num3: .word 2 letter: .asciiz "A" a. How many bytes of memory are specified,in this data segment? b. What is the value of num3? What value is stored at location Ox10010004? C.

  • Lab 6.6 – Using Value and Reference Parameters Below is a copy of the source code....

    Lab 6.6 – Using Value and Reference Parameters Below is a copy of the source code. 1 // Lab 6 swapNums.cpp -- Using Value and Reference Parameters 2 // This program uses a function to swap the values in two variables . 3 // PUT YOUR NAME HERE. 4 #include <iostream> 5 using namespace std; 6 7 // Function prototype 8 void swapNums(int, int); 9 10 /***** main *****/ 11 int main() 12 { 13 int num1 = 5, 14...

  • 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...

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