Question 1 (Mandatory) (1 point) Give the correct preprocecessor directive for the function pow(). #include O...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Question 1 (Mandatory) (1 point) Give the correct preprocecessor directive for the function pow(). #include <stdio.h> O #Jmclude <stdlib.h> #include <stdmath.h> #include <math.h> #include <stdio> Question 2 (Mandatory) (1 point) The following statement, int random = rand(time(NULL)) %10; ,will give a random value between: 1 and 10 time and (time + 10) 0 and 10 0 and 9 O to infinnity Question 3 (Mandatory) (1 point) The following statement, int random = rand ( ) %4 + 1; will give a random value between: 0 and 2 2 and 5 1 and 4 0 and 3 1 and 5 Question 4 (Mandatory) (1 point) Choose the correct function call for the given function prototype. int calculate (int A, float B, char C); int ans = calculate(); char ans = calculate(A,B,C); int ans = calculat(A,B,C'); int ans = calculate(1,2.0,A); int ans = calculate(1,2.0,'A'); choose the correct function prototype for the given function call. float A = Hello(‘A’,2,Z'); float Hello (char A, Char B, int C); float hello (char A, int B, char C); void Hello (char A, int C, char B); int Hello (char A, char B, char C); none of the above Question 6 (Mandatory) (1 point) What is the return type of the following function: void calculate (int A, char B, float C); int float void char none of the above Question 7 (Mandatory) (1 point) What is the output of the given function if A = 1. void print(int A) { return; 12 123 13 } nothing printf("1"); if (A >= 1) { printf("2"); if (A == 1) } else if (A == -2) return; printf("3"); return; Question What is the value of ans. Function call: 12 7 8 (Mandatory) (1 point) int ans = calculate (3,4); Function: int calculate(int A, int B){ if (A == 3) } else else return A*B; if (B == 4) O 12 and 7 and 1 and 0 return A + B; return B - A; return A / B; me Left:1:41:58 What wil printed on the screen? #include <stdio.h> int Rnd(float Val){ int Temp; Temp Val+ 0.5; return Temp; } int main(){ MB MASEMOLA: Attempt 1 } printf("%d", Rnd(49.769); return 0; Question 10 (Mandatory) (1 point) Which library contains the function to generate random numbers? <stdio.h> <stdlib.h> <time.h> <math.h> <bool.h> <conio.h> 4 Question 1 (Mandatory) (1 point) Give the correct preprocecessor directive for the function pow(). #include <stdio.h> O #Jmclude <stdlib.h> #include <stdmath.h> #include <math.h> #include <stdio> Question 2 (Mandatory) (1 point) The following statement, int random = rand(time(NULL)) %10; ,will give a random value between: 1 and 10 time and (time + 10) 0 and 10 0 and 9 O to infinnity Question 3 (Mandatory) (1 point) The following statement, int random = rand ( ) %4 + 1; will give a random value between: 0 and 2 2 and 5 1 and 4 0 and 3 1 and 5 Question 4 (Mandatory) (1 point) Choose the correct function call for the given function prototype. int calculate (int A, float B, char C); int ans = calculate(); char ans = calculate(A,B,C); int ans = calculat(A,B,C'); int ans = calculate(1,2.0,A); int ans = calculate(1,2.0,'A'); choose the correct function prototype for the given function call. float A = Hello(‘A’,2,Z'); float Hello (char A, Char B, int C); float hello (char A, int B, char C); void Hello (char A, int C, char B); int Hello (char A, char B, char C); none of the above Question 6 (Mandatory) (1 point) What is the return type of the following function: void calculate (int A, char B, float C); int float void char none of the above Question 7 (Mandatory) (1 point) What is the output of the given function if A = 1. void print(int A) { return; 12 123 13 } nothing printf("1"); if (A >= 1) { printf("2"); if (A == 1) } else if (A == -2) return; printf("3"); return; Question What is the value of ans. Function call: 12 7 8 (Mandatory) (1 point) int ans = calculate (3,4); Function: int calculate(int A, int B){ if (A == 3) } else else return A*B; if (B == 4) O 12 and 7 and 1 and 0 return A + B; return B - A; return A / B; me Left:1:41:58 What wil printed on the screen? #include <stdio.h> int Rnd(float Val){ int Temp; Temp Val+ 0.5; return Temp; } int main(){ MB MASEMOLA: Attempt 1 } printf("%d", Rnd(49.769); return 0; Question 10 (Mandatory) (1 point) Which library contains the function to generate random numbers? <stdio.h> <stdlib.h> <time.h> <math.h> <bool.h> <conio.h> 4
Expert Answer:
Answer rating: 100% (QA)
1 d include The pow function is used to calculate the power of a number 2 c 0 and 10 The following statement int random randtimeNULL10 will give a ran... View the full answer
Related Book For
Principles of Taxation for Business and Investment Planning 2016 Edition
ISBN: 9781259549250
19th edition
Authors: Sally Jones, Shelley Rhoades Catanach
Posted Date:
Students also viewed these accounting questions
-
In the current year (year 0), Amisha became a shareholder in Sultan Inc., a calendar year S corporation, by contributing $15,000 cash in exchange for stock. Shortly before the end of the year,...
-
In the current year Ned completely destroys his personal automobile (purchased two years earlier for $28,000) in a traffic accident. Fortunately none of the occupants are injured. The FMV of the car...
-
In the current year SPL Ltd. paid tax-free automobile allowances of 53 per kilometre to two of its employees. Employee #1 drove 15,000 km and Employee #2 drove 6,000 km in carrying out their duties...
-
Liberty Ventures Inc. reported a $320,000 profit in 2020 and declared preferred dividends of $20,000. The following changes in common shares outstanding occurred during the year: Jan 1 100,000 common...
-
How was Canadas budget deficit of 2011 influenced by the Bank of Canadas low interest rate policy?
-
On liquidation of the partnership of J. Hui and K. Cline, as of November 1, 20--, inventory with a book value of $180,000 is sold for $230,000. Given that Hui and Cline share profits and losses...
-
The following readings were taken during the test on a single cylinder four stroke oil engine : Cylinder diameter \(=270 \mathrm{~mm}\), stroke length \(=380 \mathrm{~mm}\), mean effective pressure...
-
Rogers made a contract with Salisbury Brick Corp. that allowed it to remove earth and sand from land he owned. The contract ran for four years with provision to renew it for additional four-year...
-
1 Explain what leadership is, when leaders are effective and ineffective, and the sources of power that enable managers to be effective leaders. LO10-2 Identify the traits that show the strongest...
-
Holly wants to explore the difference between buying and leasing a vehicle, both over 5 years with monthly payments. The car that she has an interest in has a value of $27000, and is located in...
-
The City of Greenville is planning to build a small wind turbine at an investment cost of $4 million. Every five years, it will cost $115,000 to service the turbine. The wind turbine is expected to...
-
Wagner Co. is a cash-basis, calendar-year taxpayer. On August 1, 2018, it paid an insurance premium of \(\$ 4,800\) for coverage from August 1, 2018 to July 31, 2019. What is the largest deduction...
-
Explain the differences between managing diversity and equal opportunities approaches to diversity management and the debates relating to these approaches.
-
Identify some of the key background issues relevant to the internationalisation of business;
-
To what extent is the new psychological contract a myth dreamed up by HR commentators to add a new dimension to discussions about SHRM?
-
Analyse the significance in the growth of multi-national companies;
-
Consider a competitive market for pork with the quantity demanded (per year) at various prices are given as follows: Price (dollars/kg) Demand (million kg) 60 22 80 20 100 18 120 16 Calculate the...
-
A Alkynes can be made by dehydrohalogenation of vinylic halides in a reaction that is essentially an E2 process. In studying the stereochemistry of this elimination, it was found that...
-
Identify the tax issue or issues suggested by the following situations and state each issue in the form of a question: Mr. Yang just sold his entire 20 percent interest in DK Partnership to an...
-
Discuss potential differences in content and style between a research memo and a client letter communicating research results.
-
Issue Recognition Problems Identify the tax issue or issues suggested by the following situations and state each issue in the form of a question. Mr. G is employed by a closely held corporation that...
-
Examine resource rental pattern on following characteristics: a. Simplicity b. Generality c. Reusability d. Completeness e. Stability f. Visual and graphical model g. Testability
-
Draw a stable class diagram for account pattern.
-
What are the advantages of separating account and entry patterns?
Study smarter with the SolutionInn App