THIS IS C++ PROGRAMMING: 1.) Which of the following are valid function calls to
ID: 3756212 • Letter: T
Question
THIS IS C++ PROGRAMMING:
1.) Which of the following are valid function calls to the fabs function?
a. fabs(3.5);
b. cout<<fabs(3.5);
c. cin>>fabs(3.5);
d. fabs(cin>>x);
e. fabs(3.5);, cout<<fabs(3.5);, and cin>>fabs(3.5);
f. fabs(3.5); and cout<<fabs(3.5);
2.) What is the output of the following program fragment?
cout << pow(2,3) << endl;
a. 16
b. 2
c. 4
d. 8
3.) floor(4.52) + ceil(2.01)
a. 8.0
b. 6.999
c. 6.0
d. 7.0
4.) Which of the following expression generate a random integer number between 1 and 10, inclusive?
a. rand()%10
b. rand()%10+1
c. rand()%11
d. rand()%9+1
5.) What is the value of i after the following function call?
//function definition
int doSomething(int value)
{
value=35;
return value;
value=13
}
//fragment of main program
int i=0;
cout<<doSomething(i);
a. 13
b. 35
c. 48
d. 0
Explanation / Answer
1-a,b,f
2-d
3-d
4-b
5-b
In Question 1
fab(3.5) is valid and you can store that value and use it.
so it is also correct way of calling fab() function
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.