Question: #include #include int main ( void ) { int * x = malloc ( sizeof ( int ) * 5 ) ; for ( int

#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: 100010011
2. If CODE A is:
printf("%d ",*x);
x +=2;
printf("%d",*x);
Output will be: 02
3. If CODE A is:
int *y = x +4;
printf("%d %d %d", x, y, y-x);
Output will be: 100010161
4. If CODE A is:
int *y = x +2;
printf("%d %d %d", x, y, y-x);
Output will be: 100010082
Group of answer choices
2 and 3
1 and 2
2 and 4
1,2,3 and 4
2 only

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!