The output of this code is __________. double incrementAndDouble(double& original) { original++; return original * 2; } int main() { double original = 5.0; double result = incrementAndDouble(original); std::cout << std::fixed << std::setprecision(1) << original << " " << result;

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter2: Using Data
Section: Chapter Questions
Problem 17RQ: When you perform arithmetic operations with operands of different types, such as adding an int and a...
icon
Related questions
Question
  1. The output of this code is __________. 

double incrementAndDouble(double& original) {

   original++;

   return original * 2;

}

 

int main() {

   double original = 5.0;

   double result = incrementAndDouble(original);

   std::cout << std::fixed << std::setprecision(1) << original << " " << result;

}

 

The following code won't compile. In one sentence, explain why the compiler doesn’t know what to do with the function call on line 10. (Hint, it will say that the function call is ambiguous.) 

double multiplyThem(double first, double second) { 
   return first * second;
}
 
double multiplyThem(double first, double second, double third=1.0) {
   return first * second * third;
}
 
int main() {
   double result = multiplyThem(5.0, 6.0);
}

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,