Question 4] All variables and headers properly defined for the C functional prog
ID: 3710208 • Letter: Q
Question
Question 4] All variables and headers properly defined for the C functional program. char s[ 8 0 1: unsigned ptr1-s; a) What is the size of the array 's' in bytes? a Ans size--_- b) ptri has a hex-decimal value of 28FE60 referring to the first element of s 1 array. What is the decimal value? c) Following this functional software; bAns_-___ for (i O; s[ i]I o'; ++i) printf( " %c: %d ",toupper( s[ i ]-(72), toupper(s[i ]-(P2))); what character sequence is output, if sll array is inputted with: florida; C. Ans-- d) For part (c) above, what is the corresponding ASCII code sequence? d. Ans e)Following this functional software for (k 25; k 20; --k) memory [k] ((10*(k-5)-20)) printf (" memory [%d]- %d", k, memory [k]); What do memory locations 22 and 24 contain? e. memory[22] _ memory[24] What is the final value for loop variable k? final k value_--Explanation / Answer
1) Size of array is 80 , In bytes as the size of char is 1 bytes so size in bytes is 80 * 1 = 80 bytes.
2) Hexadecimal to decimal
3)
Below is the output
F: 70
J: 74
K: 75
L: 76
A: 65
Z: 90
U: 85
5) Below is the output
memory[25] = 180
memory[24] = 170
memory[23] = 160
memory[22] = 150
memory[21] = 140
memory[20] = 130
6)final value will be 20 , as above loop run till k = 20.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.