Class 6 Exam  >  Class 6 Tests  >  C Programming for Beginners  >  Test: C Operators - Class 6 MCQ

Test: C Operators - Class 6 MCQ


Test Description

16 Questions MCQ Test C Programming for Beginners - Test: C Operators

Test: C Operators for Class 6 2024 is part of C Programming for Beginners preparation. The Test: C Operators questions and answers have been prepared according to the Class 6 exam syllabus.The Test: C Operators MCQs are made for Class 6 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Test: C Operators below.
Solutions of Test: C Operators questions in English are available as part of our C Programming for Beginners for Class 6 & Test: C Operators 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 Test: C Operators | 16 questions in 15 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
Test: C Operators - Question 1

What will be the output of the following C code?

    #include <stdio.h>
    int main()
    {
        int i = 3;
        int l = i / -2;
        int k = i % -2;
        printf("%d %d\n", l, k);
        return 0;
    }

Test: C Operators - Question 2

What is the precedence of arithmetic operators (from highest to lowest)?

1 Crore+ students have signed up on EduRev. Have you? Download the App
Test: C Operators - Question 3

What will be the output of the following C code?

    #include <stdio.h>
    void main()
    {
        int x = 1, y = 0, z = 5;
        int a = x && y && z++;
        printf("%d", z);
    }

Test: C Operators - Question 4

Do logical operators in the C language are evaluated with the short circuit?

Test: C Operators - Question 5

What will be the output of the following program?

Detailed Solution for Test: C Operators - Question 5

The comma operator evaluates both of its operands and produces the value of the second. It also has lower precedence than assignment. Hence c = a, b is equivalent to c = a, while d = (a, b) is equivalent to d = b.

Test: C Operators - Question 6

What will be the output of the following C code?

    #include <stdio.h>
    int main()
    {
        int i = 10;
        int *p = &i;
        printf("%d\n", *p++);
    }

Test: C Operators - Question 7

What will be the output of this program on an implementation where int occupies 2 bytes?

Detailed Solution for Test: C Operators - Question 7

Evaluating ++i + ++i would produce undefined behavior, but the operand of sizeof is not evaluated, so i remains 3 throughout the program. The type of the expression (int) is reduced at compile time, and the size of this type (2) is assigned to j.

Test: C Operators - Question 8

What will be the output of the following C code?

    #include <stdio.h>
    void main()
    {
        int k = 8;
        int x = 0 == 1 && k++;
        printf("%d%d\n", x, k);
    }

Test: C Operators - Question 9

What will be the value of the following assignment expression?

 (x = foo())!= 1 considering foo() returns 2

Test: C Operators - Question 10

Determine the Output

Detailed Solution for Test: C Operators - Question 10

In the expression !i>14 , NOT (!) operator has more precedence than ' >' symbol. ! is a unary logical operator. !i (!10) is 0 (not of true is false). 0>14 is false (zero).

Test: C Operators - Question 11

What will be the output of the following C code?

    #include <stdio.h>
    void main()
    {
        int x = 5.3 % 2;
        printf("Value of x is %d", x);
    }

Test: C Operators - Question 12

What will be the output of the following C code?

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

Test: C Operators - Question 13

What will be the final value of j in the following C code?

    #include <stdio.h>
    int main()
    {
        int i = 0, j = 0;
        if (i && (j = i + 10))
            //do something
            ;
    }

Test: C Operators - Question 14

Which among the following is NOT a logical or relational operator?

Test: C Operators - Question 15

What will be the output of the following C code?

    #include <stdio.h>
    int main()
    {
        int i = 0;
        int j = i++ + i;
        printf("%d\n", j);
    }

Test: C Operators - Question 16

What will be the output of the following C code?

 #include <stdio.h>
    void main()
    {
        int a = 5, b = -7, c = 0, d;
        d = ++a && ++b || ++c;
        printf("\n%d%d%d%d", a,  b, c, d);
    }

10 videos|13 docs|15 tests
Information about Test: C Operators Page
In this test you can find the Exam questions for Test: C Operators solved & explained in the simplest way possible. Besides giving Questions and answers for Test: C Operators, 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