Table of Contents
Operators in C: Overview and Examples
🔒 Please log in to unlock this course.
MCQ Section
MCQ 1
Which bit wise operator is suitable for checking whether a particular bit is on or off?
Locked. Enroll to open this MCQ.
MCQ 2
Which of the following operator takes only integer operands?
Locked. Enroll to open this MCQ.
MCQ 3
What is the output of this C code? #include void main() { if(sizeof(int)>-1) printf("yes"); else…
Locked. Enroll to open this MCQ.
MCQ 4
In an expression involving || operator, evaluation I. Will be stopped if one of its components…
Locked. Enroll to open this MCQ.
MCQ 5
What is the output of this C code? #include int main() { int i = -5; int k = i %4; printf("%dn",…
Locked. Enroll to open this MCQ.
MCQ 6
Which bitwise operator is suitable for turning on a particular bit in a number?
Locked. Enroll to open this MCQ.
MCQ 7
What is the output of this C code? #include void main() { int i=0, j=1, k=2, m; m = i++ || j++ ||…
Locked. Enroll to open this MCQ.
MCQ 8
Which bitwise operator is suitable for turning off a particular bit in a number?
Locked. Enroll to open this MCQ.
MCQ 9
What is the output of this C code? #include int main() { int i = 5; int l = i / -4; int k = i % -4;…
Locked. Enroll to open this MCQ.
MCQ 10
What is the output of this C code? #include void main() { int c = - -2; printf("c=%d", c); }
Locked. Enroll to open this MCQ.
MCQ 11
What is the output of this C code? #include int main() { int i = 7; i = i / 4; printf("%d\n", i);…
Locked. Enroll to open this MCQ.
MCQ 12
In which numbering system can the binary number 1011011111000101 be easily converted to?
Locked. Enroll to open this MCQ.
MCQ 13
What is the output of this C code? #include void main() { int i=10; i = !i>14; printf("i=%d", i); }
Locked. Enroll to open this MCQ.
MCQ 14
What is the value of x in this C code? #include void main() { int x = 4 *5 / 2 + 9; printf("%d",x);…
Locked. Enroll to open this MCQ.
MCQ 15
Assunming, an integer is 2 byte, What will be the output of the program? #include int main() {…
Locked. Enroll to open this MCQ.
MCQ 16
What is the output of this C code? #include void main() { int x = 4.3 % 2; printf("Value of x is…
Locked. Enroll to open this MCQ.
MCQ 17
If an unsigned int is 2 bytes wide then, What will be the output of the program? #include int…
Locked. Enroll to open this MCQ.
MCQ 18
In C programming language, which of the following type of operators have the highest precedence
Locked. Enroll to open this MCQ.
MCQ 19
Assuming an integer 2-bytes, What will be the output of the program? #include int main() {…
Locked. Enroll to open this MCQ.
MCQ 20
What is the output of this C code? #include void main() { int y = 3; int x = 7 % 4 * 3 / 2;…
Locked. Enroll to open this MCQ.
MCQ 21
What will be the output of the following program? #include void main() { int a, b, c, d; a = 3; b =…
Locked. Enroll to open this MCQ.
MCQ 22
If an unsigned int is 2 bytes wide then, What will be the output of the program? #include int…
Locked. Enroll to open this MCQ.
MCQ 23
What is the output of this C code? #include void main() { int a = 5; int b = ++a + a++ + --a;…
Locked. Enroll to open this MCQ.
MCQ 24
Which of the following comments about the ++ operator is correct?
Locked. Enroll to open this MCQ.
MCQ 25
What will be the output of the program? #include int main() { unsigned char i = 0x80;…
Locked. Enroll to open this MCQ.
MCQ 26
What will be the output of this program on an implementation where int occupies 2 bytes?
Locked. Enroll to open this MCQ.
MCQ 27
The precedence of arithmetic operators is (from highest to lowest)?
Locked. Enroll to open this MCQ.
MCQ 28
What will be the output of the program? #include int main() { printf("%d >> %d %d >> %d\n", 4 >> 1,…
Locked. Enroll to open this MCQ.
MCQ 29
Which of the following is not an arithmetic operation?
Locked. Enroll to open this MCQ.
MCQ 30
Which operator has the lowest priority?
Locked. Enroll to open this MCQ.
MCQ 31
Which of the following data type will throw an error on modulus operation(%)?
Locked. Enroll to open this MCQ.
MCQ 32
What is the output of this C code? #include int main() { int a = 20; double b = 15.6; int c; c = a…
Locked. Enroll to open this MCQ.
MCQ 33
What will be the output? #include void main(){ int a=10, b=20; char x=1, y=0; if(a,b,x,y){…
Locked. Enroll to open this MCQ.
MCQ 34
What will be the output of the program? #include int main() { char c=48; int i, mask=01; for(i=1; i
Locked. Enroll to open this MCQ.
MCQ 35
What is the output of this C code? #include int main() { int a = 20, b = 15, c = 5; int d; d = a ==…
Locked. Enroll to open this MCQ.
MCQ 36
What will be the output? #include void main() { int z, x=5, y= -10, a=4, b=2; z = x++ - --y*b/a;…
Locked. Enroll to open this MCQ.
MCQ 37
What is the output of this C code? #include void main() { int x = 0; if (x = 0) printf("It's…
Locked. Enroll to open this MCQ.
MCQ 38
What is the output of this C code? #include void main() { int k = 8; int x = 0 == 1 && k++;…
Locked. Enroll to open this MCQ.
MCQ 39
What is the output of the following Program?
Locked. Enroll to open this MCQ.
MCQ 40
What is the output of the following Program?
Locked. Enroll to open this MCQ.
MCQ 41
What is the output of this C code? #include void main() { char a = 'a'; int x = (a % 10)++;…
Locked. Enroll to open this MCQ.
MCQ 42
What will be the output of the program? #include int main() { printf("%d %d\n", 32-0); return 0; }
Locked. Enroll to open this MCQ.
MCQ 43
What will be the output of the program? #include int main() { int i=32, j=0x20, k, l, m; k=i|j;…
Locked. Enroll to open this MCQ.
MCQ 44
What will be the output of the following code fragment?(32-bit machine)
Locked. Enroll to open this MCQ.
MCQ 45
What will be the output of the program? #include int main() { int i=4, j=8; printf("%d, %d, %d\n",…
Locked. Enroll to open this MCQ.
MCQ 46
Find the output of the following program #include void main() { int y=10; if(y++>9 && y++!=10 &&…
Locked. Enroll to open this MCQ.
MCQ 47
What will be the output of the program? #include int main() { unsigned int res; res = (64…
Locked. Enroll to open this MCQ.
MCQ 48
Find the output of the following program. #include void main() { int y=10; if(y++>9 && y++!=11 &&…
Locked. Enroll to open this MCQ.
MCQ 49
Determine output of the following program code. #include void main() { int a, b=7; a = b1 : a;…
Locked. Enroll to open this MCQ.
MCQ 50
Choose the correct output for the following program. #include void main() { 1 < 2 ? return 1:…
Locked. Enroll to open this MCQ.
MCQ 51
Choose the correct output for the following program. #include void main() { int a=10, b=11, c=13,…
Locked. Enroll to open this MCQ.
MCQ 52
What is the output of this C code? #include int main() { int x = 2, y = 1; x *= x + y;…
Locked. Enroll to open this MCQ.
MCQ 53
Consider the following program fragment, and choose the correct one #include void main() { int a, b…
Locked. Enroll to open this MCQ.
MCQ 54
Which of the following statements are correct about the program? #include int main() { unsigned int…
Locked. Enroll to open this MCQ.
MCQ 55
Which operator from the following has the lowest priority?
Locked. Enroll to open this MCQ.
MCQ 56
What is the output of this C code? #include int main() { int x = 2, y = 2; x /= x / y;…
Locked. Enroll to open this MCQ.
MCQ 57
Which of the following statements are correct about the program? #include int main() { unsigned int…
Locked. Enroll to open this MCQ.
MCQ 58
What is the output of this C code? #include int main() { int x = 1, y = 0; x &&= y; printf("%d\n",…
Locked. Enroll to open this MCQ.
MCQ 59
Identify the correct output of the following code: #include void main() { int w=10, x=5, y=3, z=3;…
Locked. Enroll to open this MCQ.
MCQ 60
What is the type of the below assignment expression if x is of type float, y is of type int? y = x…
Locked. Enroll to open this MCQ.
MCQ 61
Given b=110 and c=20, what is the value of 'a' after execution of the expression a=b-=c*=5?
Locked. Enroll to open this MCQ.
MCQ 62
Operation "a = a * b + a" can also be written as:
Locked. Enroll to open this MCQ.
MCQ 63
for c = 2, value of c after c
Locked. Enroll to open this MCQ.
MCQ 64
What is the output of this C code? #include int main() { int a = 1, b = 2; a += b -= a; printf("%d…
Locked. Enroll to open this MCQ.
MCQ 65
Left shifting a number by 1 is always equivalent to multiplying it by 2.
Locked. Enroll to open this MCQ.
MCQ 66
What is the output of this C code? int main() { int a = 4, n, i, result = 0; scanf("%d", n); for (i…
Locked. Enroll to open this MCQ.
MCQ 67
Which of the following is an invalid assignment operator?
Locked. Enroll to open this MCQ.
MCQ 68
What is the output of this C code? int main() { int c = 2 ^ 3; printf("%d\n", c); }
Locked. Enroll to open this MCQ.
MCQ 69
What is the output of this C code? int main() { unsigned int a = 10; a = ~a; printf("%d\n", a); }
Locked. Enroll to open this MCQ.
MCQ 70
What is the output of this C code? int main() { if (7 & 8) printf("Honesty"); if ((~7 & 0x000f) ==…
Locked. Enroll to open this MCQ.
MCQ 71
What is the output of this C code? int main() { int a = 10; if (a == a--) printf("TRUE 1\t"); a =…
Locked. Enroll to open this MCQ.
MCQ 72
Relational operators cannot be used on:
Locked. Enroll to open this MCQ.
MCQ 73
What is the output of this C code? int main() { int x = -2; if (!0 == 1) printf("yes\n"); else…
Locked. Enroll to open this MCQ.
MCQ 74
What is the output of this C code? int main() { int y = 0; if (1 |(y = 1)) printf("y is %d\n", y);…
Locked. Enroll to open this MCQ.
MCQ 75
What is the output of this C code? int main() { int y = 1; if (y & (y = 2)) printf("true %d\n");…
Locked. Enroll to open this MCQ.
MCQ 76
What is the difference between the following 2 codes? //Program 1 int main() { int d, a = 1, b = 2;…
Locked. Enroll to open this MCQ.
MCQ 77
What is the output of this C code? int main() { int a = 1, b = 1, c; c = a++ + b; printf("%d, %d",…
Locked. Enroll to open this MCQ.
MCQ 78
What is the output of this C code? int main() { int a = 2; if (a >> 1) printf("%d\n", a); }
Locked. Enroll to open this MCQ.
MCQ 79
What is the output of this C code? void main() { int x = 97; int y = sizeof(x++); printf("x is %d",…
Locked. Enroll to open this MCQ.
MCQ 80
What is the output of this C code? void main() { int x = 4, y, z; y = --x; z = x--;…
Locked. Enroll to open this MCQ.
MCQ 81
What is the output of this C code? void main() { int x = 4; int *p = &x; int *k = p++; int r = p -…
Locked. Enroll to open this MCQ.
MCQ 82
Are logical operators sequence points?
Locked. Enroll to open this MCQ.
MCQ 83
Does logical operators in C language are evaluated with short circuit?
Locked. Enroll to open this MCQ.
MCQ 84
The result of a logical or relational expression in C is?
Locked. Enroll to open this MCQ.
MCQ 85
What will be the value of d in the following program? int main() { int a = 10, b = 5, c = 5; int d;…
Locked. Enroll to open this MCQ.
MCQ 86
What is the output of this C code? int main() { int a = 10, b = 5, c = 3; b != !a; c = !!a;…
Locked. Enroll to open this MCQ.
MCQ 87
What is the output of this C code? void main() { int a = 5, b = -7, c = 0, d; d = ++a && ++b ||…
Locked. Enroll to open this MCQ.
MCQ 88
What is the output of this C code? void main() { int a = -5; int k = (a++, ++a); printf("%d\n", k);…
Locked. Enroll to open this MCQ.
MCQ 89
What is the output of this C code?
Locked. Enroll to open this MCQ.
MCQ 90
What is the output of this C code? int main() { int x = -2; x = x >> 1; printf("%d\n", x); }
Locked. Enroll to open this MCQ.
MCQ 91
What is the output of this C code? int main() { if (~0 == 1) printf("yes\n"); else printf("no\n"); }
Locked. Enroll to open this MCQ.
MCQ 92
What is the output of this C code? int main() { int x = 1, y = 0, z = 3; x > y ? printf("%d", z) :…
Locked. Enroll to open this MCQ.
MCQ 93
What is the output of this C code? void main() { int x = 1, z = 3; int y = x
Locked. Enroll to open this MCQ.
MCQ 94
What is the output of this C code? void main() { int x = 0, y = 2, z = 3; int a = x & y | z;…
Locked. Enroll to open this MCQ.
MCQ 95
What is the final value of j in the below code? int main() { int i = 0, j = 0; if (i && (j = i +…
Locked. Enroll to open this MCQ.
MCQ 96
What is the output of this C code? int main() { int i = 1; if (i++ && (i == 1)) printf("Yes\n");…
Locked. Enroll to open this MCQ.
MCQ 97
What is the output of this C code? int main() { int a = 1, b = 1, d = 1; printf("%d, %d, %d", ++a +…
Locked. Enroll to open this MCQ.
MCQ 98
What is the output of this C code? int main() { int a = 10, b = 10; if (a = 5) b--; printf("%d,…
Locked. Enroll to open this MCQ.
MCQ 99
What is the output of this C code? int main() { int i = 0; int j = i++ + i; printf("%d\n", j); }
Locked. Enroll to open this MCQ.
MCQ 100
What is the output of this C code? int main() { int i = 2; int j = ++i + i; printf("%d\n", j); }
Locked. Enroll to open this MCQ.
MCQ 101
What is the output of this C code? void main() { int a = 5, b = -7, c = 0, d; d = ++a && ++b ||…
Locked. Enroll to open this MCQ.
MCQ 102
What is the output of this C code? void main() { int a = -5; int k = (a++, ++a); printf("%d\n", k);…
Locked. Enroll to open this MCQ.
MCQ 103
What is the output of this C code? void main() { int x = 1, y = 0, z = 5; int a = x && y || z++;…
Locked. Enroll to open this MCQ.
MCQ 104
What is the output of this C code? void main() { int x = 1, y = 0, z = 5; int a = x && y && z++;…
Locked. Enroll to open this MCQ.
MCQ 105
Comment on the output of this C code? int main() { int i = 2; int i = i++ + i; printf("%d\n", i); }
Locked. Enroll to open this MCQ.
MCQ 106
What is the output of this C code? int main() { int i = 0; int x = i++, y = ++i; printf("%d % d\n",…
Locked. Enroll to open this MCQ.
MCQ 107
What is the output of this C code? void main() { int x = 97; int y = sizeof(x++); printf("X is %d",…
Locked. Enroll to open this MCQ.
MCQ 108
What is the output of this C code? void main() { int x = 4, y, z; y = --x; z = x--;…
Locked. Enroll to open this MCQ.
MCQ 109
What will be the output of the following program? #include"stdio.h" main() { int i, j, k, l, m;…
Locked. Enroll to open this MCQ.
MCQ 110
Which of the following Bitwise operators can be used efficiently to swap two numbers?
Locked. Enroll to open this MCQ.
MCQ 111
Which of the following is not logical operator?
Locked. Enroll to open this MCQ.
MCQ 112
In mathematics and computer programming, which is the correct order of mathematical operators ?
Locked. Enroll to open this MCQ.
MCQ 113
What would be the output of the following program? #include void main() { char *s1, *s2; printf("%d…
Locked. Enroll to open this MCQ.
MCQ 114
What will the the output of the following program? #include "stdio.h" int main() { int x, y = 5, z…
Locked. Enroll to open this MCQ.
MCQ 115
What will the output of the follwing code? #include // Assume base address of "ABCDEQuiz" to be…
Locked. Enroll to open this MCQ.
MCQ 116
What is the purpose of a '?' in programming languages?
Locked. Enroll to open this MCQ.
Get C Programming Language for Problem Solving updates by email
Short, practical lessons and course updates from Rumman Ansari. No spam.