subject

Consider the following code: #include #include int main(void) { int *x = malloc(sizeof(int) * 5); for(int i = 0; i < 5; i++) { *(x+i) = i; } code a return 0; } assume that size of an integer is 4 bytes and value of x to be 1000 in decimal. which of the the following 4 cases for code a are correct? 1. if code a is: int *y = x+1; printf("%d %d %d", x, y, y-x); output will be: 1000 1001 1 2. if code a is: printf("%d ", *x); x += 2; printf("%d", x); output will be: 0 2 3. if code a is: int *y = x + 4; printf("%d %d %d" , x, y, *(y-3)); output will be: 1000 1016 1 4. if code a is: int *y = x + 2; printf("%d %d %d" , x, y, y-x); output will be: 1000 1008 2

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 23:00
Is an attack that relies on guessing the isns of tcp packets
Answers: 2
question
Computers and Technology, 23.06.2019 08:00
Which argument is not a valid filter? does not equal this quarter filter by cell color all of these are valid filter arguments.
Answers: 2
question
Computers and Technology, 23.06.2019 15:30
Hey so i was just trying out some game hacks so i took a paste from online and built it in my visual studio and then suddenly my computer was working or clicking on stuff on its own am i hacked?
Answers: 1
question
Computers and Technology, 24.06.2019 12:50
Write a new lc-3 trap subroutine (i.e. a subroutine that will be invoked via the trap instruction) that will receive a numeric digit entered at the keyboard (i.e. an ascii character), echo it to the screen, and return in r0 the corresponding numeric value: so if the user types the digit '7', the character '7' will appear on the screen, but the value returned in r0 will be b0000 0000 0000 0111 (#7) you may not use any trap calls in your code - you must implement the "polling" code that interrogates the keyboard status and data registers. ; getnum_tsr ; a subroutine for obtaining a numeric value ; given ascii numeric digit input to keyboard. ; the numeric digit is echoed to the console (e.g. '7' = b0000 0000 0011 0111), ; but the value returned in r0 is the actual numeric value ; corresponding to the digit (e.g. b0000 0000 0000 0111 =
Answers: 3
You know the right answer?
Consider the following code: #include #include int main(void) { int *x = malloc(sizeof(int) * 5);...
Questions
Questions on the website: 13722360