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...
-
Using the realtor sales information from Exercise 13.14, the realtor makes a typical commission of $4000 on each home sold, but he needs to pay an assistant $900 each week. a. What is the realtor's...
-
Pal Corporation acquired a 75 percent interest in Sun Corporation on January 1, 2011, for $360,000 in cash. Financial statements of Pal and Sun Corporations for 2011 are as follows (in thousands):...
-
Thermal regeneration of a fixed-bed adsorber is based on the fact that the adsorption process is exothermic; therefore, heating the saturated adsorbent will result in desorption. The dynamics of the...
-
Outdoor Athletic Equipment Co. operates two divisionsthe Winter Sports Division and the Summer Sports Division. The following income and expense accounts were provided from the trial balance as of...
-
Part A The device shown in (Figure 1) is designed to exert a large force on the stationary object at the left. The jack exerts a 225-lb upward force at B. As a result, the link BC exerts a force on...
-
Champion Inc. purchased a call option as a speculative investment on January 1 for $125, allowing Champion Inc. to purchase 200 of Rising Star Co. common shares at $100 per share through January 1 of...
-
You have been asked to calculate the Return on Investment (ROI) for a project whose development will be accomplished during a single calendar year with the go-live date of Jan 1 st The project, to...
-
A skateboard ramp is built with an incline angle of 5 pie / 1 2 . If the base of the ramp is 1 m in length, determine the exact height of the ramp.
-
Listening can affect a listener's ability to understand or process a message. Recall a moment when you had difficulty or biases in listening to a message from anyone speaking (a sender). Was it...
-
Calculate the sum of numbers. Use bellowed rules on your code, Input how many numbers use on summation. Input number and check the number is negative or positive. If number is positive, add to the...
-
The speed at which people can read is typically measured in words per minute (wpm), which is just the average number of words a person can read within one minute. Suppose the distribution of reading...
-
output: Write a C++ program code for the following c:\users\hp01\documents\visual studio 2012\projects\... Note: Attach the Screenshot of your implementation code and output.
-
The graph of a polynomial function y = g(x), is shown at right. Identify the properties and characteristics in the exercises. N (2.5,-3) 8 A. Domain: Range: C. State the interval(s) where g (x) > 0...
-
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...
-
Why is it said that the PSNR principle has both a right and a duty side? Which one is most relevant with respect to international environmental law?
-
How many dimensions of the PSNR principle can you enumerate? To which one does UN Resolution 1803(1962) refer?
-
If there is a separate principle of precaution, do we need a principle of prevention?
Study smarter with the SolutionInn App