Question: . Write blocks of code to perform the functions used in the following main program. Your blocks must match the given title lines. Each block

. Write blocks of code to perform the functions used in the following main program. Your blocks must match the given title lines. Each block should be a short function of only a few lines. int main(){//(a) Print the number of odd arguments, here 1 cout << numberOdd(7,8)<< endl; //(b) Print closest integer here 4 cout << closest(3.75)<< endl; //(c) Print maximum value, here 4 cout << max(3,1,4,1)<< endl; //(d) Print the first digit, assume argument is positive. Here 1. cout << firstDigit(19683)<< endl; return 0; } a. int numberOdd(int x, int y) b. int closest(double x) c. int max(int a, int b, int c, int d) d. int firstDigit(int x)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!