Class 6 Exam  >  Class 6 Tests  >  C Programming for Beginners  >  Structures & Pointers - Class 6 MCQ

Structures & Pointers - Class 6 MCQ


Test Description

10 Questions MCQ Test C Programming for Beginners - Structures & Pointers

Structures & Pointers for Class 6 2024 is part of C Programming for Beginners preparation. The Structures & Pointers questions and answers have been prepared according to the Class 6 exam syllabus.The Structures & Pointers MCQs are made for Class 6 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Structures & Pointers below.
Solutions of Structures & Pointers questions in English are available as part of our C Programming for Beginners for Class 6 & Structures & Pointers solutions in Hindi for C Programming for Beginners course. Download more important topics, notes, lectures and mock test series for Class 6 Exam by signing up for free. Attempt Structures & Pointers | 10 questions in 10 minutes | Mock test for Class 6 preparation | Free important questions MCQ to study C Programming for Beginners for Class 6 Exam | Download free PDF with solutions
Structures & Pointers - Question 1

What is a structure in C language.?

Detailed Solution for Structures & Pointers - Question 1

struct insurance
{
int age;
char name[20];
}

Structures & Pointers - Question 2

What is the output of C program with structures.?

int main()
{
    structure hotel
    {
        int items;
        char name[10];
    }a;
    strcpy(a.name, "TAJ");
    a.items=10;
    printf("%s", a.name);
    return 0;
}

Detailed Solution for Structures & Pointers - Question 2

Keyword used to declare a structure is STRUCT not structURE in lowercase i.e struct.

1 Crore+ students have signed up on EduRev. Have you? Download the App
Structures & Pointers - Question 3

Choose a correct statement about C structures.

Detailed Solution for Structures & Pointers - Question 3

struct book

int SNO=10; //not allowed
};

Structures & Pointers - Question 4

What is the output of C program.?

int main()
{
    struct ship
    {
        int size;
        char color[10];
    }boat1, boat2;
    boat1.size=10;
    boat2 = boat1;
    printf("boat2=%d",boat2.size);
    return 0;
}

Detailed Solution for Structures & Pointers - Question 4

Yes, it is allowed to assign one structure variables. boat2=boat1. Remember, boat1 and boat2 have different memory locations.

Structures & Pointers - Question 5

What is the output of C program with structures.?

int main()
{
    struct tree
    {
        int h;
    }
    struct tree tree1;
    tree1.h=10;
    printf("Height=%d",tree1.h);
    return 0;
}

Detailed Solution for Structures & Pointers - Question 5

Notice a missing semicolon at the end of structure definition.
struct tree
{
   int h;
};

Structures & Pointers - Question 6

What is the output of C program with structures pointers.?

int main()
{
    struct forest
    {
        int trees;
        int animals;
    }F1,*F2;
    F1.trees=1000;
    F1.animals=20;
    F2=&F1;
    printf("%d ",F2.animals);
    return 0;
}

Detailed Solution for Structures & Pointers - Question 6

F2.animal is not allowed as F2 is a pointer to structure variable. So use ARROW operators. F2->animal.

Structures & Pointers - Question 7

What is the output of C program with Structure pointer in TurboC.?

int main()
{
    struct books{
        int pages;
        char str[4];
    }*ptr;
    printf("%d",sizeof(ptr));
    return 0;
}

Detailed Solution for Structures & Pointers - Question 7

Memory reserved will be the size of sum of individual elements.

Structures & Pointers - Question 8

What is actually passed if you pass a structure variable to a function.?

Detailed Solution for Structures & Pointers - Question 8

Yes. If you pass a structure variable by value without & operator, only a copy of the variable is passed. So changes made within that function do not reflect in the original variable.

Structures & Pointers - Question 9

What is the output of C program with structures.?

int main()
{
    struct paint{
        int type;
        int color;
    }p1, p2;
    p1.type=1;
    p1.color=5;
    if(sizeof(p1)==sizeof(p2))
    {
        printf("SAME");
    }
    else
    {
        printf("DIFFERENT");
    }
    return 0;
}

Detailed Solution for Structures & Pointers - Question 9

Yes. Before and after initialization, size of a structure variable does not change.

Structures & Pointers - Question 10

What is the output of c program with structures.?

int main()
{
    struct car
    {int color;};
    struct garage
    {
        struct car mycar[10];
    }gar;
    struct car c1={5};
    gar.mycar[0]=c1;
    printf("%d",gar.mycar[0]);
    return 0;
}

Detailed Solution for Structures & Pointers - Question 10

It is an example of nested structures.

10 videos|13 docs|15 tests
Information about Structures & Pointers Page
In this test you can find the Exam questions for Structures & Pointers solved & explained in the simplest way possible. Besides giving Questions and answers for Structures & Pointers, EduRev gives you an ample number of Online tests for practice

Top Courses for Class 6

10 videos|13 docs|15 tests
Download as PDF

Top Courses for Class 6