Grade 7 Exam  >  Grade 7 Test  >  C Programming for Beginners  >  Test: C Variables - Grade 7 MCQ

C Variables - Free MCQ Practice Test with solutions, Grade 7 Programming


MCQ Practice Test & Solutions: Test: C Variables (15 Questions)

You can prepare effectively for Grade 7 C Programming for Beginners with this dedicated MCQ Practice Test (available with solutions) on the important topic of "Test: C Variables". These 15 questions have been designed by the experts with the latest curriculum of Grade 7 2026, to help you master the concept.

Test Highlights:

  • - Format: Multiple Choice Questions (MCQ)
  • - Duration: 10 minutes
  • - Number of Questions: 15

Sign up on EduRev for free to attempt this test and track your preparation progress.

Test: C Variables - Question 1

What will be the output of the following C code?

    #include <stdio.h>
    int x;
    void main()
    {
        printf("%d", x);
    }

Test: C Variables - Question 2

What will be the output of the following C code?

    #include <stdio.h>
    int x = 5;
    void main()
    {
        int x = 3;
        printf("%d", x);
        {
            int x = 4;
        }
        printf("%d", x);
    }

Test: C Variables - Question 3

Global variables are ____________

Test: C Variables - Question 4

Which part of the program address space is p stored in the following C code?

    #include <stdio.h>
    int *p = NULL;
    int main()
    {
        int i = 0;
        p = &i;
        return 0;
    }

Test: C Variables - Question 5

What will be the output of the following C code (without linking the source file in which ary1 is defined)?

    #include <stdio.h>
    int main()
    {
        extern ary1[];
        printf("scope rules\n");
    }

Test: C Variables - Question 6

Array sizes are optional during array declaration by using ______ keyword.

Test: C Variables - Question 7

Automatic variables are allocated space in the form of a __________

Test: C Variables - Question 8

What is the scope of an automatic variable?

Test: C Variables - Question 9

What will be the output of the following C code?

     #include <stdio.h>
    int main()
    {
        printf("%d", d++);
    }
    int d = 10;

Test: C Variables - Question 10

What will be the output of the following C code?

    #include <stdio.h>
    static int x = 5;
    void main()
    {
        x = 9;
        {
            int x = 4;
        }
        printf("%d", x);
    }

Test: C Variables - Question 11

Comment on the following 2 C programs.

    #include <stdio.h> //Program 1
    int main()
    {
        int a;
        int b;
        int c;
    }
 
   #include <stdio.h> //Program 2
    int main()
    {
        int a;
        {
            int b;
        }
        {
            int c;
        }
    }

Test: C Variables - Question 12

What will be the output of the following C code?

    #include <stdio.h>
    static int x = 5;
    void main()
    {
        int x = 9;
        {
            x = 4;
        }
        printf("%d", x);
    }

Test: C Variables - Question 13

Automatic variables are stored in ________

Test: C Variables - Question 14

Which of the following storage class supports char data type?

Test: C Variables - Question 15

What will be the x in the following C code?

    #include <stdio.h>
    void main()
    {
        int x;
    }

10 videos|14 docs|15 tests
Information about Test: C Variables Page
In this test you can find the Exam questions for Test: C Variables solved & explained in the simplest way possible. Besides giving Questions and answers for Test: C Variables, EduRev gives you an ample number of Online tests for practice
10 videos|14 docs|15 tests
Download as PDF