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

Q281.
The operator used to get value at address stored in a pointer variable is
Discuss
Answer: (a).*
Q282.
What will be the output of the program ?
#include<stdio.h>

int main()
{
    static char *s[] = {"black", "white", "pink", "violet"};
    char **ptr[] = {s+3, s+2, s+1, s}, ***p;
    p = ptr;
    ++p;
    printf("%s", **p+1);
    return 0;
}
Discuss
Answer: (a).ink
Q283.
What will be the output of the program ?
#include<stdio.h>

int main()
{
    int i=3, *j, k;
    j = &i;
    printf("%d\n", i**j*i+*j);
    return 0;
}
Discuss
Answer: (a).30
Q284.
What will be the output of the program ?
#include<stdio.h>

int main()
{
    int x=30, *y, *z;
    y=&x; /* Assume address of x is 500 and integer is 4 byte size */
    z=y;
    *y++=*z++;
    x++;
    printf("x=%d, y=%d, z=%d\n", x, y, z);
    return 0;
}
Discuss
Answer: (d).x=31, y=504, z=504
Q285.
What will be the output of the program ?
#include<stdio.h>

int main()
{
    char str[20] = "Hello";
    char *const p=str;
    *p='M';
    printf("%s\n", str);
    return 0;
}
Discuss
Answer: (a).Mello
Q286.
What will be the output of the program If the integer is 4 bytes long?
#include<stdio.h>

int main()
{
    int ***r, **q, *p, i=8;
    p = &i;
    q = &p;
    r = &q;
    printf("%d, %d, %d\n", *p, **q, ***r);
    return 0;
}
Discuss
Answer: (a).8, 8, 8
Q287.
What will be the output of the program ?
#include<stdio.h>

void fun(void *p);
int i;

int main()
{
    void *vptr;
    vptr = &i;
    fun(vptr);
    return 0;
}
void fun(void *p)
{
    int **q;
    q = (int**)&p;
    printf("%d\n", **q);
}
Discuss
Answer: (c).0
Q288.
What will be the output of the program ?
#include<stdio.h>

int main()
{
    char *str;
    str = "%s";
    printf(str, "K\n");
    return 0;
}
Discuss
Answer: (c).K
Q289.
What will be the output of the program ?
#include<stdio.h>
int *check(static int, static int);

int main()
{
    int *c;
    c = check(10, 20);
    printf("%d\n", c);
    return 0;
}
int *check(static int i, static int j)
{
    int *p, *q;
    p = &i;
    q = &j;
    if(i >= 45)
        return (p);
    else
        return (q);
}
Discuss
Answer: (c).Error: Non portable pointer conversion
Q290.
What will be the output of the program if the size of pointer is 4-bytes?
#include<stdio.h>

int main()
{
    printf("%d, %d\n", sizeof(NULL), sizeof(""));
    return 0;
}
Discuss
Answer: (c).4, 1

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!