Question: C programming QUESTION 1 (a) Given: int x = 10, y = 5, z = 20, A; Determine the value of variable A for each

 C programming QUESTION 1 (a) Given: int x = 10, y

C programming

QUESTION 1 (a) Given: int x = 10, y = 5, z = 20, A; Determine the value of variable A for each of the following mathematical expression. Please include the key steps to derive the value of A. (1) A = x + y + z/ X (2 marks) () A = x++ * --y-y; (2 marks) (1) A = 2% x + y++; (2 marks) (b) Write a complete program to generate the square root of odd numbers from 1 to 101 (use a for-loop) Partial output screen Num Square Root =================== 1 1.80 1.73 2.24 2.65 9 3.08 11 3.32 13 3.61 15 3.87 17 4.12 19 4.36 4.58 23 4.80 25 5.00 27 5.28 29 5.39 31 5.57 33 5.74 (5 marks) (0) Write a complete C program to declare an integer 2-dimensional antay named arr, size 4 * 5. Populate the array arr with the following values, and display the values as output. Output screen [0] [1] [2] [3] [O] [1] 0 0 0 1 0 2 0 3 [2] [3] [4] 0 0 0 2 3 4 4 4 6 8 6 9 12 0 0 0 0 E 1 2 3 4 2 4 6 8 3 6 9 12 648 (7 marks) Continued... GCL 1/4 BIC1024 BUSINESS APPLICATIONS DEVELOPMENT ASSIGNMENT 2 (d) Write a complete program that generates random members and calculates the total and average. Ensure that each time the program runs a different set of random numbers are generated Sample output screen Random number generated: 32011 Generate another random number(yin)? y Random number generated: 5373 Generate another random number(y)? y Random number generated: 5138 Generate another randon number(y)? y Random number generated: 19141 Generate another randon number(y)? n :: TOTAL : 61663 :: AVERAGE : 15415.75 (12 marks)

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!