adplus-dvertising

Welcome to the Data Types,Operators and Expressions in C MCQs Page

Dive deep into the fascinating world of Data Types,Operators and Expressions in C with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Data Types,Operators and Expressions in C, a crucial aspect of C Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Data Types,Operators and Expressions 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 Data Types,Operators and Expressions 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 Data Types,Operators and Expressions in C. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Data Types,Operators and Expressions in C MCQs | Page 16 of 66

Q151.
The code snippet below produces
#include <stdio.h>
    void main()
    {
        1 < 2 ? return 1 : return 2;
    }
Discuss
Answer: (d).Compile time error
Q152.
The output of the code below is
#include <stdio.h>
    void main()
    {
        int k = 8;
        int m = 7;
        k < m ? k++ : m = k;
        printf("%d", k);
    }
Discuss
Answer: (c).Compile time error
Q153.
The output of the code below is
#include <stdio.h>
    void main()
    {
        int k = 8;
        int m = 7;
        k < m ? k = k + 1 : m = m + 1;
        printf("%d", k);
    }
Discuss
Answer: (a).Compile time error
Q154.
For initialization a = 2, c = 1 the value of a and c after this code will be

c = (c) ? a = 0 : 2;
Discuss
Answer: (a).a = 0, c = 0;
Q155.
What will be the data type of the expression

(a < 50) ? var1 : var2;

provided a = int, var1 = double, var2 = float
Discuss
Answer: (c).double
Q156.
Which expression has to be present in the following?

exp1 ? exp2 : exp3;
Discuss
Answer: (d).All of the mentioned
Q157.
Value of c after the following expression (initialization a = 1, b = 2, c = 1):

c += (-c) ? a : b;
Discuss
Answer: (c).c = 2
Q158.
Comment on the following expression?

c = (n) ? a : b; can be rewritten as
Discuss
Answer: (a).if (!n)c = b; else c = a;
Q159.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        reverse(1);
    }
    void reverse(int i)
    {
        if (i > 5)
            exit(0);
        printf("%d\n", i);
        return reverse(i++);
    }
Discuss
Answer: (d).Stack overflow
Q160.
What is the output of this C code?
#include <stdio.h>
    void reverse(int i);
    int main()
    {
        reverse(1);
    }
    void reverse(int i)
    {
        if (i > 5)
            return ;
        printf("%d ", i);
        return reverse((i++, i));
    }
Discuss
Answer: (a).1 2 3 4 5

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!