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

Explore more Topics under C Programming

Q451.
What is the output of this program?
#include <stdio.h>
void test(int *a, int *b) 
{ 
  a = b; 
  *a = 15; 
} 
int x = 10, y = 20; 
int main() 
{ 
  test(&x;, &y;); 
  printf("%d %d", x, y);
  return 0; 
}
Discuss
Answer: (b).10 15
Discuss
Answer: (b).ptr is a pointer to an array of 5 integers
Q453.
What is the output of this program?
#include <stdio.h> 
int main()
{
int a = 5;
void *ptr = &a; ;
printf("%f", *(float*)ptr);
return 0;
}

a.

5

b.

5

c.

0

d.

0

Discuss
Answer: (d).0
Q454.
What is the output of the given code ?
#include <stdio.h>
void main()
{
int a = 0 ;     
int *const ptr = &a; ; 
printf("%p ", ptr);
ptr++;
printf("%p ", ptr);
}
Discuss
Answer: (b).compilation Error
Q455.
What is the output of this program?
#include <stdio.h>
void main()
{
int a = 5 ;
int *b = &a; ;
int **c = &b; ;
printf("%d %d %d", a, *b, **c);
}
Discuss
Answer: (c).5 5 5
Q456.
What is the output of this program?
#include <stdio.h>
void main()
{
int arr[3] = {1, 2, 3};
int *ptr = arr;
int **temp = &ptr; ; 
printf("%p %p", *temp, arr);
}
Discuss
Answer: (a).Same Address
Q457.
The pointer ptr points to which string?
char *ptr;
char myString[]="compsciedu";
ptr=myString
ptr+=5;
Discuss
Answer: (b).ciedu
Q458.
What will be the output ?
void main()
{
char far *farther, *farthest;
printf("%d %d", sizeof(farther), sizeof(farthest));
}
Discuss
Answer: (a).4 2
Q459.
What is the output of this program?
#include <stdio.h>
void test(int * , int *);
void main()
{
  int a = 5 , b = 6;
  test(&a;,&b;);
  printf("%d %d",a,b);
}
void test(int *p, int *q)
{
  *p = *p * *q;
  *q = *p + *q;
  *p = *p - *q;
}
Discuss
Answer: (a).-6 36
Q460.
Will the program compile?
#include<stdio.h>
int main()
{
    char str[5] = "Compsciedu";
    return 0;
}
Discuss
Answer: (a).Yes

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!