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

Q311.
What will be the output of the program?
#include<stdio.h>
int main()
{
    int k, num=30;
    k = (num>5 ? (num <=10 ? 100 : 200): 500);
    printf("%d\n", num);
    return 0;
}
Discuss
Answer: (b).30
Q312.
What will be the output of the program?
#include<stdio.h>
int main()
{
    char ch;
    ch = 'A';
    printf("The letter is");
    printf("%c", ch >= 'A' && ch <= 'Z' ? ch + 'a' - 'A':ch);
    printf("Now the letter is");
    printf("%c\n", ch >= 'A' && ch <= 'Z' ? ch : ch + 'a' - 'A');
    return 0;
}
Discuss
Answer: (a).The letter is a Now the letter is A
Q313.
What will be the output of the program?
#include<stdio.h>
int main()
{
    int i=2;
    int j = i + (1, 2, 3, 4, 5);
    printf("%d\n", j);
    return 0;
}

a.

4

b.

7

c.

6

d.

5

Discuss
Answer: (b).7
Discuss
Answer: (b).External, Internal and None
Q315.
Is there any difference between following declarations?
1 :
extern int fun();

2 :
int fun();
Discuss
Answer: (b).No difference, except extern int fun(); is probably in another file
Q316.
Which of the following is not user defined data type?

1 :
struct book
{
char name[10];
float price;
int pages;
};

2 :
long int l = 2.35;

3 :
enum day {Sun, Mon, Tue, Wed};
Discuss
Answer: (b).2
Q317.
Identify which of the following are declarations


1 :
extern int x;


2 :
float square ( float x ) { ... }


3 :
double pow(double, double);
Discuss
Answer: (c).1 and 3
Q318.
In the following program where is the variable a getting defined and where it is getting declared?
#include<stdio.h>
int main()
{
    extern int a;
    printf("%d\n", a);
    return 0;
}
int a=20;
Discuss
Answer: (a).extern int a is declaration, int a = 20 is the definition
Q319.
What is the output of the program given below ?
#include<stdio.h>
int main()
{
    enum status { pass, fail, atkt};
    enum status stud1, stud2, stud3;
    stud1 = pass;
    stud2 = atkt;
    stud3 = fail;
    printf("%d, %d, %d\n", stud1, stud2, stud3);
    return 0;
}
Discuss
Answer: (c).0, 2, 1
Q320.
What will be the output of the program in 16 bit platform (Turbo C under DOS)?
#include<stdio.h>
int main()
{
    extern int i;
    i = 20;
    printf("%d\n", sizeof(i));
    return 0;
}
Discuss
Answer: (d).Linker Error : Undefined symbol 'i'

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!