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 10:00
When is an original work considered public domain? a. when posted via social media b. when it is posted on the internet c. when a copyright symbol is not included with the piece of work d. when explicit permission is given by the author / owner
Answers: 1
question
Computers and Technology, 22.06.2019 19:20
Consider the following code snippet: #ifndef cashregister_h#define cashregister_hconst double max_balance = 6000000.0; class cashregister{public: cashregister(); cashregister(double new_balance); void set_balance(double new_balance); double get_balance() const; private: double balance[12]; }; double get_monthly_balance(cashregister bk, int month); #endifwhich of the following is correct? a)the header file is correct as given.b)the definition of max_balance should be removed since header files should not contain constants.c)the definition of cashregister should be removed since header files should not contain class definitions.d)the body of the get_monthly_balance function should be added to the header file.
Answers: 1
question
Computers and Technology, 22.06.2019 21:00
Describir textbook icon_person mira los dibujos y describe lo que está pasando. usa los verbos de la lista.
Answers: 1
question
Computers and Technology, 24.06.2019 12:30
Why does the pc send out a broadcast arp prior to sending the first ping request
Answers: 1
You know the right answer?
Consider the following code: #include #include int main(void) { int *x = malloc(sizeof(int) * 5);...
Questions
question
History, 09.07.2021 02:30
question
Mathematics, 09.07.2021 02:30
question
Mathematics, 09.07.2021 02:30