Loading...

C Multiple Choice Questions

Our C questions and answers focuses on all areas of C programming language covering 100+ topics in C

C Operators and Expression-3 MCQs

C Operators and Expression-3


1. If i j,k are integer variable with values 1,2,3 respectively, then what is the value of the expression

a) 6
b) 5
c) 1
d) 0



2. The expression a << 6 shifts all bits of a six places to the left. If a Ox6db7, then what is the value of a << 6

a) 0xa72b
b) 0xa2b
c) 0x6dc0
d) 0x1111



3. Choose the correct statements

a) address operator cannot be applied to register variables
b) misuse of register declaration will increase the execution time
c) Both (a) & (b)
d) none of above



4. Choose the correct statement for the given code:
int **a;

a) is illegal
b) is legal but meaningless
c) is syntactically and semantically correct
d) none of these



5. Determine Output:
void main() {
  int i = 0, j = 1, k = 2, m;
  m = i++ || j++ || k++;
  printf("%d %d %d %d", m, i, j, k);
}

a) 1 1 2 3
b) 1 1 2 2
c) 0 1 2 2
d) 0 1 2 3
e) None of these



6. Determine Output :
void main() {
  int c = - -2;
  printf("c = %d", c);
}

a) 1
b) -2
c) 2
d) Error



7. Determine Output:
void main() {
  int i = 10;
  i = !i>14;
  printf("i = %d", i);
}

a) 10
b) 14
c) 0
d) None of these



8. What is the output of the following statements?
  int b = 15, c = 5, d = 8, e = 8, a;
  a = b>c ? 12 : d>e ? 13 : 14 :15;
  printf("%d", a);

a) 13
b) 14
c) 15
d) 12
e) Garbage Value



9. What is the use of size() operator?

a) To get the size of data types or variables in bytes
b) To get size of data types only
c) To get size of the variables only
d) All of the above



10. What is the use of typedef keyword?

a) To create user defined data type
b) To create special functions
c) To change the meaning of built in datatypes
d) None of the above



- Related Topics