Q1. Write C++ statements to do the following: a. Declare an array alpha of 15 co
ID: 3761136 • Letter: Q
Question
Q1. Write C++ statements to do the following: a. Declare an array alpha of 15 components of type int b. Output the value of the tenth element of the array alpha c. Set the value of the fourth element to three times the value of eighth element d. Set the value of the first component of the array alpha to 35 e. val is an empty vector of ints. Write a sdatement that stores the value 27 in val. Q2. What would the heading for a value returning function named Min look like if it had two double parameters, num1 and num2, and returned a double result? Q3 Convert the following void function with one reference parameter into an equivalent non-void function with one value parameterExplanation / Answer
1.
int alpha[15];
cout << "Tenth element : "<<alpha[9];
alpha[3] = 3*alpha[7];
alpha[0] = 35;
val.push_back(27);
2. double Min(double num1,double num2);
3. int func(int n)
{
return n*2;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.