Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Solve this problem with C language. Answer each of the following. Assume that single-precision floating-point numbers are stored in 4 bytes, and that the starting
Solve this problem with C language. Answer each of the following. Assume that single-precision floating-point numbers are stored in 4 bytes, and that the starting address of the array is at location 1002500 in memory. Each part of the exercise should use the results of previous parts where appropriate (4x10- 40 pts). 4. a) Define an array of type float called numbers with 10 elements, and initialize the elements to the values 0.0, 1.1, 2.2.,.., 9.9. Assume the symbolic constant SIZE has been defined as 1o. b) Define a pointer, nPtr, that points to an object of type float. c) Print the elements of array numbers using array subscript notation. Use a for statement and assume the integer control variable i has been defined. Print each number with 1 position of precision to the right of the decimal point. d) Give two separate statements that assign the starting address of array numbers to the pointer variable nPtr. e) Print the elements of array numbers using pointer/offset notation with the pointer nPtr. f) Print the elements of array numbers using pointer/offset notation with the array name as the pointer. 8) Print the elements of array numbers by subscripting pointer nPtr. h) Refer to element 4 of array numbers using array subscript notation, pointer/offset notation with the array name as the pointer, pointer subscript notation with nPtr and pointer/offset notation with nPtr nPtr + 8? What value is stored at that location? value stored at that location? i) Assuming that nPtr points to the beginning of array numbers, what address is referenced by i) Assuming that nPtr points to numbers(5], what address is referenced by nPtr-4. What is the
Solve this problem with C language.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started