Operator in C MCQs Exercise I

Ques 1 Operator


Identify the operator (&&) ________

A Logical Operator
B Assignment Operator
C Relational Operator
D All of these

Ques 2 Operator


What is the output of the following code ?
     int main()
     {
     int x=2,y=5;
     (x&y)?printf("TRUE"):printf("FALSE");
     (x&&y)?printf("TRUE"):printf("FALSE");
     return 0;
     }

A FALSE FALSE
B TRUE TRUE
C FALSE TRUE
D TRUE FALSE

Ques 3 Operator


An operator consists _____

A Values
B value and variable
C &&
D Keywords

Ques 4 Operator


What is the output of the following code ?
  int main()
  {
     int x=21;
     printf("%d",x<<1);
     printf("%d",x>>1);
     return 0;
  }

A 42 10
B 10 10
C 45 10
D 10 45

Ques 5 Operator


What will be the output of the following C code___
   int main()
   {
     int x=2;
     (x&1)?printf("Odd"):printf("Even");
     return 0;
   }

A Odd
B Even
C Syntax Error
D Runtime Error