Do While Loop | Infinity Loop- C Questions(Previous Year)-2

Technical Placement Questions(Previous Year)-2

Do While Loop | Infinity Loop- C questions

C Questions

 

  1. Which of the following sorting algorithms does NOT have a worst-case running time of O(n2)?
    1. Insertion sort
    2. Merge sort
    3. Quicksort
    4. Bubble sort                     Answer : B
  2. How many times is a do while loop guaranteed to loop?
    1. 0
    2. Variable
    3. 1
    4. Infinitely                         Answer : C
  3. Which of the following storage classes have global visibility in C?
    1. Auto
    2. Static
    3. Extern
    4. Register                                  Answer : C
  4. A full binary tree with n leaves contains
    1. n nodes
    2. 2n – 1 nodes
    3. log2 n nodes
    4. 2n nodes                                  Answer : B
  5. The Case keyword is followed by?
    1. Float values
    2. Character values
    3. Integer values
    4. Both b&c                                   Answer : D
  6. ype of data and its value is described dy
    1. Constants
    2. Variables
    3. Data Type
    4. None of the above                      Answer : B
  7. myarr[5] is equivalent of?
    1. &(myarr + 5)
    2. *(myarr + 5)
    3. (*myarr + 5)
    4. None of the above                       Answer : B
  8. How to make an infinity loop in C?
    1. loop: ….. goto loop;
    2. for(;;) { }
    3. while(1) { }
    4. All of the above                          Answer : D

Previous page

Next page

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
%d bloggers like this: