adplus-dvertising

Welcome to the Pointers and Arrays in C MCQs Page

Dive deep into the fascinating world of Pointers and Arrays in C with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Pointers and Arrays in C, a crucial aspect of C Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Pointers and Arrays in C, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within C Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Pointers and Arrays in C. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of C Programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Pointers and Arrays in C. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Pointers and Arrays in C MCQs | Page 20 of 53

Q191.
What will be the output of the program ?
#include<stdio.h>
void main()
{
    int a[5] = {5, 1, 15, 20, 25};
    int i, j, m;
    i = ++a[1];
    j = a[1]++;
    m = a[i++];
    printf("%d, %d, %d", i, j, m);
}
Discuss
Answer: (a).3, 2, 15
Q192.
What will be the output of following program code?
#include <stdio.h>
int main(void)
{
    char p;
    char buf[10] = {1, 2, 3, 4, 5, 6, 9, 8};
    p = (buf + 1)[5];
    printf("%d", p);
    return 0;
}
Discuss
Answer: (c).9
Q193.
Let x be an array. Which of the following operations are illegal?
Discuss
Answer: (d).I, III and IV
Q194.
What is the maximum number of dimensions an array in C may have?
Discuss
Answer: (d).Theoratically no limit. The only practical limits are memory size and compilers.
Q195.
Consider the following type definition. What will sizeof(myArray) be ? (Assume one character occupies 1 byte)
typedef char x[10];
x myArray[5];
Discuss
Answer: (c).50
Q196.
What will be printed after execution of the following code?
void main()
{
      int arr[10] = {1,2,3,4,5};
      printf("%d", arr[5]);
}
Discuss
Answer: (d).0
Q197.
What will be the output of the following program?
void main()
{
      char str1[] = "abcd";
      char str2[] = "abcd";
      if(str1==str2)
            printf("Equal");
      else
            printf("Unequal");
}
Discuss
Answer: (b).Unequal
Q198.
What will be the output of the following code?
void main()
{
      int a[10];
      printf("%d %d", a[-1], a[12]);
}
Discuss
Answer: (d).Garbage Value Garbage Value
Discuss
Answer: (b).ptr is a pointer to an array of 10 integers
Q200.
What will be the output of the program if the array begins at 65472 and each integer occupies 2 bytes?
#include
void main()
{
    int a[3][4] = {1, 2, 3, 4, 4, 3, 2, 1, 7, 8, 9, 0};
    printf("%u, %u", a+1, &a+1);
}
Discuss
Answer: (c).65480, 65496

Suggested Topics

Are you eager to expand your knowledge beyond C Programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!