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 24 of 53

Explore more Topics under C Programming

Q231.
Find the output of the following program.
void main()
{
   int array[10];
   int *i = &array[2], *j = &array[5];
   int diff = j-i;
   printf("%d", diff);
}
Discuss
Answer: (a).3
Q232.
Find the output of the following program.
void main()
{
   printf("%d, %d", sizeof(int *), sizeof(int **));
}
Discuss
Answer: (c).2, 2
Q233.
Find the output of the following program.
void main()
{
   int i=10;  /* assume address of i is 0x1234ABCD */
   int *ip=&i;
   int **ipp=&&i;
   printf("%x,%x,%x", &i, ip, *ipp);  
}
Discuss
Answer: (d).Syntax error
Q234.
Which of the following statements are true after execution of the program.
void main()
{
   int a[10], i, *p;
   a[0] = 1;
   a[1] = 2;
   p = a;
   (*p)++;
}
Discuss
Answer: (b).a[0] = 2
Q235.
What is the base data type of a pointer variable by which the memory would be allocated to it?
Discuss
Answer: (d).unsigned int
Q236.
What would be the output for the following Turbo C code?
#include<stdio.h>
void main()
{
   int a[]={ 1, 2, 3, 4, 5 }, *p;
   p=a;
   ++*p;
   printf("%d ", *p);
   p += 2;
   printf("%d", *p);
}
Discuss
Answer: (d).2 3
Q237.
what string does ptr point to in the sample code below?
char *ptr;
char myString[] = "abcdefg";
ptr = myString;
ptr += 5;
Discuss
Answer: (a).fg
Q238.
Determine output:
void main()
{
      int const *p=5;
      printf("%d", ++(*p));
}
Discuss
Answer: (d).Compiler Error
Q239.
Determine Output:
void main()
{
      char s[]="man";
      int i;
      for(i=0; s[i]; i++)
            printf("%c%c%c%c ", s[i], *(s+i), *(i+s), i[s]);
}
Discuss
Answer: (d).None of These
Q240.
Determine Output:
#include<stdio.h>
void main()
{
      register i=5;
      char j[]= "hello";
      printf("%s %d", j, i);
}
Discuss
Answer: (a).hello 5

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!