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 2 of 66

Explore more Topics under C Programming

Q11.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        int y = 10000;
        int y = 34;
        printf("Hello World! %d\n", y);
        return 0;
    }
Discuss
Answer: (a).Compile time error
Q12.
Which of the following is not a valid variable name declaration?
Discuss
Answer: (d).#define PI 3.14
Q13.
What will happen if the below program is executed?
#include <stdio.h>
    int main()
    {
        int main = 3;
        printf("%d", main);
        return 0;
    }
Discuss
Answer: (c).It will run without any error and prints 3
Q14.
What is the problem in following variable declaration?

float 3Bedroom-Hall-Kitchen?;
Discuss
Answer: (d).All of the above
Q15.
Comment on the output of this C code?
#include <stdio.h>
    int main()
    {
        int ThisIsVariableName = 12;
        int ThisIsVariablename = 14;
        printf("%d", ThisIsVariablename);
        return 0;
    }
Discuss
Answer: (b).The program will print 14
Q16.
Which of the following cannot be a variable name in C?
Discuss
Answer: (a).volatile
Q17.
Comment on the output of this C code?
#include <stdio.h>
    int main()
    {
        int a[5] = {1, 2, 3, 4, 5};
        int i;
        for (i = 0; i < 5; i++)
            if ((char)a[i] == '5')
                printf("%d\n", a[i]);
            else
                printf("FAIL\n");
    }
Discuss
Answer: (d).Program will compile and print FAIL for 5 times
Q18.
What is the output of this C code?
#include  <stdio.h>
    int main()
    {
       signed char chr;
       chr = 128;
       printf("%d\n", chr);
       return 0;
    }
Discuss
Answer: (b).-128
Q19.
Comment on the output of this C code?
#include  <stdio.h>
    int main()
    {
        char c;
        int i = 0;
        FILE *file;
        file = fopen("test.txt", "w+");
        fprintf(file, "%c", 'a');
        fprintf(file, "%c", -1);
        fprintf(file, "%c", 'b');
        fclose(file);
        file = fopen("test.txt", "r");
        while ((c = fgetc(file)) !=  -1)
            printf("%c", c);
        return 0;
    }
Discuss
Answer: (a).a
Q20.
Comment on the output of this C code?
#include <stdio.h>
    int main()
    {
        float f1 = 0.1;
        if (f1 == 0.1)
            printf("equal\n");
        else
            printf("not equal\n");
    }
Discuss
Answer: (b).not equal

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!