Question

If the size of an integer is 8 bytes, and an address (pointer) needs 4 bytes,...

If the size of an integer is 8 bytes, and an address (pointer) needs 4 bytes, what will be the output of the program?

#include<stdio.h>

int main()

{

    int arr[] = {12, 13, 14, 15, 16};

    printf("%d, %d, %d\n", sizeof(arr), sizeof(*arr), sizeof(arr[0]));

    return 0;

}

A

20, 4, 4

B

40, 4, 8

C

20, 2, 4

D

4, 4, 4

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Option A) 20,4,4

Add a comment
Know the answer?
Add Answer to:
If the size of an integer is 8 bytes, and an address (pointer) needs 4 bytes,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT