Online Test for C

  1. The best data structure to check whether an arithmetic expression has balanced parenthesis is a
    Queue
    Stack
    Tree
    List

  1. = is used for comparison, whereas, == is used for assignment of two quantities.
    True
    False


  1. Which of the following is NOT a valid Real Constant?
    +345.23
    45 22.22
    0.000564
    -3.2

  1. What is default storage class of variables in C language?
    extern
    local
    auto
    global

  1. Which of the following is a valid Integer Constant?
    35,75
    3 455
    +3333
    *56

  1. The ++ operator increments the operand by 1, whereas, the -- operator decrements it by 1.
    True
    False


  1. Find Error/Output in follwing code:
  2.                                 
    void fn() {
    
     int a = 10;
     static int b = 20;
     printf("a = %d b = %d", ++a, ++b);

    int main() {
     fn();
     fn();
     return 0;
    }
    a = 11 b = 21 a = 11 b = 22
    a = 11 b = 21 a = 11 b = 22
    a = 11 b = 21 a = 11 b = 22
    a = 11 b = 21 a = 11 b = 22

  1. What is Dequeue?
    Elements can be added from front
    Elements can be added to or removed from either the front or rear
    Elements can be added from rear
    None of the above

  1. Find Error/Output in follwing code:
  2.                                 
    int main() {
    
      int m = -10, n = 20;
      n = (m < 0) ? 0 : 1;
      printf("%d %d", m, n);
    }
    -10 0
    10 20
    20 -10
    0 1

  1. The keywords are also called
    Safe words
    Static words
    Reserved words
    Reused words

Post Your Question
Social Sharing
Search