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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 01:00, joedawg50
What is added to the < meta > tag to describe the encoding type?
Answers: 1
image
Computers and Technology, 23.06.2019 01:00, lusciousl
Petrică, tânăr licean în clasa a ix-a, a primit în dar de la părinţii săi un cont bancar pentru micile sale cheltuieli curente. el este pasionat de internet banking şi îşi verifică cu grijă toate tranzacţiile efectuate. pentru creşterea securităţii tranzacţiilor online, banca îi furnizează lui petrică un număr pe care el va trebui să îl modifice, obţinând un număr tan – număr de autentificare a tranzacţiei (transaction authentication number). regula de obţinere a numărului tan este următoarea: se formează cel mai mic număr par din toate cifrele numărului furnizat de bancă. cerinţă cunoscând numărul n furnizat de bancă, să se determine numărul tan obţinut de petrică. date de intrare fişierul tan. in conţine pe prima linie numărul natural n cu semnificaţia din enunţ. date de ieşire fişierul de ieşire tan. out va conţine o singură linie pe care va fi scris numărul tan cerut. restricţii • 0 < n < 18*1018 • n are cel puţin o cifră pară • numărul tan obţinut nu poate conţine zerouri nesemnificative
Answers: 2
image
Computers and Technology, 24.06.2019 18:20, 12375819
Use a while-end loop in a script file to calculate the sum of the first n terms of the series: summation sign on the top n bottom k=1 : )^k * k^2 +5k)/3^k show the script file and the two results of n = 10 and n = 20.
Answers: 2
image
Computers and Technology, 25.06.2019 01:30, parislover2000
What controls can be found on the file tab of microsoft word
Answers: 1
You know the right answer?
Consider the following code: #include #include int main(void) { int *x = malloc(sizeof(int) * 5);...

Questions in other subjects:

Konu
Social Studies, 15.02.2021 21:40
Konu
Mathematics, 15.02.2021 21:40