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

Q211.
What will be the correct output of the following program?
#include<string.h>
void main()
{
   char str[] = "C EXAMINATION", rev[17];
   int i = strlen(str), j=0;
   for( ; i>=0; rev[j++] = str[i--]);
   rev[j] = '�';
   puts(rev);
}
Discuss
Answer: (d).No output at all
Q212.
The function sprintf() works like printf(), but operates on ..........
Discuss
Answer: (c).string
Q213.
Determine Output:
void main()
{
      char far *farther, *farthest;
      printf("%d..%d", sizeof(farther), sizeof(farthest));
}
Discuss
Answer: (a).4..2
Q214.
Determine Output:
main()
{
      char *str1 = "abcd";
      char str2[] = "abcd";
      printf("%d %d %d", sizeof(str1), sizeof(str2), sizeof("abcd"));
}
Discuss
Answer: (c).8 5 5
Q215.
Choose the best answer.
Prior to using a pointer variable
Discuss
Answer: (c).It should be both declared and initialized
Q216.
What will be the output?
main() 
{ 
      char *p; 
      p = "Hello"; 
      printf("%cn",*&*p); 
}
Discuss
Answer: (b).H
Q217.
Determine output:
#include <stdio.h>
void main()
{
      char *p = NULL;
      char *q = 0;
      if(p)
            printf(" p ");
      else
            printf("nullp");
      if(q)
            printf("q");
      else
            printf(" nullq");
}
Discuss
Answer: (d).nullp nullq
Q218.
The address operator &, cannot act on
Discuss
Answer: (c).Both of the above
Discuss
Answer: (c).is syntactically and semantically correct
Q220.
What will be the output of the following program?
#include<stdio.h>
void main()
{
      int i = 10;
      void *p = &i;
      printf("%d\n", (int)*p);
}
Discuss
Answer: (a).Compiler time error

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!