Problem 24
Write the definition of a void function that takes as input two decimal numbers. If the first number is nonzero, it outputs the second number divided by the first number; otherwise, it outputs a message indicating that the second number cannot be divided by the first number because the first number is 0 .
Problem 25
Write the definition of a void function with three reference parameters of type int, double, and string. The function sets the values of the int and double variables to 0 and the value of the string variable to the empty string.
Problem 27
include
Problem 28
include
Problem 29
In the following program, number the marked statements to show the order
in which they will execute (the logical order of execution). Also, what is
the output if the input is 10?
#include
Problem 30
include
Problem 33
What is the output of the following code fragment? (Note: alpha and beta are int variables.) alpha = 5; beta = 10; if (beta >= 10) { int alpha = 10; beta = beta + alpha; cout << alpha << ' ' << beta << endl; } cout << alpha << ' ' << beta << endl;
Problem 34
include
Problem 35
include
Problem 38
Consider the following function definition:
void defaultParam(int num1, int num2 = 7, double z = 2.5)
{
int num3;
num1 = num1 + static_cast