Based on this C code below answer the following questions / questions are after the code #include #define MAX

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Based on this C code below answer the following questions / questions are after the code #include #define MAX

Post by answerhappygod »

Based on this C code below answer the following questions /
questions are after the code
#include <stdio.h>
#define MAX 10
int
main()
{
double A[MAX] = { 1.11, 2.22, 3.33, 4.44, 5.55,
6.66, 7.77, 8.88 };
// 0 1 2
3 4 5 6
7
// ASSUMPTIONS:
// 1. Assume that the address of the first
element
// &A[0] is FF88 in
hexadecimal (let's keep it simple
// by using only 4
hexadecimal digits).
// 2. Assume that the sizeof(double) is 8
bytes.
// 3. Assume that the sizeof(double *) is 8
bytes.
// ...other codes...
return 0;
}
What is the data type of the expression A + 3? Your answer must be
an actual C data type (for example, you should write int not the
English word integer).
What is the data type of the expression &A[7]? Your answer must
be an actual C data type (for example, you should write int not the
English word integer).
What is the value of &A[8]? Your answer must be a 4 digit
hexadecimal number (you may use lower or upper case for A to
F).
What is the data type of the expression *(A + 8)? Your answer must
be an actual C data type (for example, you should write int not the
English word integer).
What is the size of the last array element, i.e., sizeof(A[9])?
Your answer must be a number in Arabic (for example, you should
write 12 not the English word twelve).
What is the data type of the expression A[4]? Your answer must be
an actual C data type (for example, you should write int not the
English word integer).
What is the value of &A[1]? Your answer must be a 4 digit
hexadecimal number (you may use lower or upper case for A to
F).
What is the value of A[10]? Write the word GARBAGE if you think the
value is garbage.
What is the sizeof(A)? Your answer must be a number in Arabic (for
example, you should write 12 not the English word twelve).
What is the data type of A based on the given variable definition?
Your answer must be an actual C data type (for example, you should
write int not the English word integer).
What is the memory address of the VERY LAST BYTE allocated to array
A? Your answer must be a 4 digit hexadecimal number (you may use
lower or upper case for A to F).
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply