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

Q201.
What will be the output of the program ?
#include
int main()
{
    int arr[1] = {10};
    printf("%d", 0[arr]);
    return 0;
}

a.

1

b.

0

c.

10

d.

6

Discuss
Answer: (c).10
Q202.
What will be the output of the program if the array begins at address 65486?
#include
void main()
{
    int arr[] = {12, 14, 15, 23, 45};
    printf("%u, %u", arr, &arr);
}
Discuss
Answer: (d).65486, 65486
Q203.
What will be the output of the program ?
#include
void main()
{
    float arr[] = {12.4, 2.3, 4.5, 6.7};
    printf("%d", sizeof(arr)/sizeof(arr[0]));
}

a.

5

b.

4

c.

6

d.

7

Discuss
Answer: (b).4
Q204.
Which of the following is correct way to define the function fun() in the below program?
#include<stdio.h>
void main()
{
    int a[3][4];
    fun(a);
}
Discuss
Answer: (a).void fun(int p[][4]){}
Q205.
Which of the following statements are correct about the program below?
#include<stdio.h>
void main()
{
    int size, i;
    scanf("%d", &size);
    int arr[size];
    for(i=1; i<=size; i++)
    {
        scanf("%d", arr[i]);
        printf("%d", arr[i]);
    }
}
Discuss
Answer: (a).The code is erroneous since the statement declaring array is invalid.
Q206.
Which of the following statements are correct about an array?

1. The array int num[26]; can store 26 elements.
2. The expression num[1] designates the very first element in the array.
3. It is necessary to initialize the array at the time of declaration.
4. The declaration num[SIZE] is allowed if SIZE is a macro.
Discuss
Answer: (b).1, 4
Q207.
What will be the output of the program ?
#include<stdio.h>
#include<string.h>
void main()
{
    char str1[20] = "Hello", str2[20] = " World";
    printf("%sn", strcpy(str2, strcat(str1, str2)));
}
Discuss
Answer: (a).Hello World
Q208.
What will be the output of the program ?
#include<stdio.h>
void main()
{
    printf(5+"Good Morning");
}
Discuss
Answer: (d).Morning
Q209.
What will be the output of the program ?
#include
#include
void main()
{
    char str[] = "Computer\0Science";
    printf("%s", str);
}
Discuss
Answer: (a).Computer
Q210.
int a[5] = {1,2,3}

What is the value of a[4]?
Discuss
Answer: (d).Garbage Value

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!