Logo
search
menuicon
प्रीमियम मानचित्र क्विज़
लॉक्ड (प्लान समाप्त)
thubnail
ZEP QUIZ भाड़े के सैनिकPro
फ्रीस्टाइल
कॉलेज
अन्य
Accenture_quiz
Sankar Narayan
1
प्रश्न जोड़ा गया (10/ 20)
गलत उत्तर की अनुमति दें
उत्तर दिखाएँ
सार्वजनिक क्विज़

# 1

बहुविकल्पी

In C programming, when you have an array `int a[] = {10, 20, 30, 40};` and a pointer `int *p = a;`, what is the difference in the output of `sizeof(a)` and `sizeof(p)` assuming a 4-byte integer and an 8-byte pointer?

  • sizeof(a) will be 16 bytes and sizeof(p) will be 8 bytes.
  • sizeof(a) will be 4 bytes and sizeof(p) will be 8 bytes.
  • sizeof(a) will be 8 bytes and sizeof(p) will be 16 bytes.
  • sizeof(a) will be 8 bytes and sizeof(p) will be 4 bytes.

# 2

बहुविकल्पी

When an array like `int a[5] = {1, 2, 3, 4, 5};` is passed to a function `void fun(int a[])`, what will `sizeof(a)` print inside the `fun` function, assuming a 4-byte integer?

  • 20 bytes (the total size of the array)
  • 4 bytes (the size of a single integer)
  • 8 bytes (the size of a pointer)
  • This will cause a compilation error.

# 3

बहुविकल्पी

Consider the C code: `int a[] = {5, 10, 15, 20}; int i = 0; a[i++] += 5; a[++i] += 10;`. What will be the values in array `a` after these operations?

  • 10 10 25 20
  • 5 10 15 20
  • 10 10 15 30
  • 10 20 25 20

# 4

बहुविकल्पी

In the C code `int a[] = {2, 4, 6, 8, 10, 12}; for (i = 0; i < 6; i += 2) { a[i+1] = a[i] + a[i+1]; }`, which elements of the array `a` will be modified and how?

  • a[1] becomes 6, a[3] becomes 14, a[5] becomes 22.
  • a[1] becomes 6, a[3] becomes 14.
  • a[0] becomes 6, a[2] becomes 14, a[4] becomes 22.
  • All elements will be modified.
सभी 10 प्रश्न देखना चाहते हैं?
ZEP QUIZ से जुड़ें और 800,000+ क्विज़ मुफ्त में पाएँ।लॉग इन करें और सभी का अन्वेषण करें