Question
In the program presented below, use as a reference the numbering of the instructions in the column on the left to answer the following: By
In the program presented below, use as a reference the numbering of the
instructions in the column on the left to answer the following:
By what instructions does this program run when it runs? In what order?
Suppose that a value of 10 is entered into the input variable when the program reaches the
instruction cin on the line (8).
Be careful to identify exactly in which order C ++ executes the instructions
of this program.
Line
#include
using namespace std;
void func1() (1)
{
cout << "Pude hablar con Juan. "; (2)
}
void func2(int input) (3)
{
cout << "Vi a Juan a las " << input << ". "; (4)
}
int main() (5)
{
int input; (6)
cout << "Enter a number: "; (7)
cin >> input; (8)
if (input < 10) (9)
{
func1(); (10)
func2(input); (11)
}
else
{
func2(input); (12)
func1(); (13)
}
return 0; (14)
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started