Problems For the following problems, assume the C programming language. 17.1 Dec
ID: 3810685 • Letter: P
Question
Problems For the following problems, assume the C programming language. 17.1 Declare a signed integer variable named abc. 17.2 Declare an unsigned short variable named xyz, and assign the value of 23458 to it. 17.3 Declare a char variable named Esc that is initialized to the value lb16. 17.4 Using the following declaration, show the output for the listed gdb commands unsigned short a 1234 a. ptype a b. print sizeof(a) c. print/x a d. print /z a e. print /d a 17.5 Using the following declaration and assignment, show the output for the listed gdb commands. signed char b; 134 a. ptype b b. print b c. print /d b d. print /u b 17.6 Declare an uninitialized array of three unsigned shorts with the name of bazinga. 17.7 For the following array, show the gdb command to print the fourth element and the resulting value. short primes 2, 3, 5, 7, 11, 13, 17, 19 h; 17.8 For the array in problem 17.7, show the expression that calculates the number of elements in the array.Explanation / Answer
Answers for 17.1, 17.2, 17.3:
#include <stdio.h>
int main()
{
signed int abc;
unsigned short xyz = 1253; // 1253 is decimal value of 2345 octal value
char esc = atoi(27) ;//27 is the decimal ASCII value for Escape'
printf("Hello, World! ");
return 0;
}
17.4:
unsigned short 2 4D2 04D2 1234
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.