Scroll to Top

Array Index | Binary Search- C Questions(Previous Year)-3

Array Index | Binary Search- C Questions

C Questions

  1. What does the following declaration mean? int (*ptr) [10];
    1. ptr is an array of pointers of 10 integers.
    2. ptr is a pointer to an array of 10 integers.
    3. ptr is an array of 10 integers.
    4. None of the above                         Answer : B
  2. The correct way to round off a floating number x to an integer value is
    1. y = int (x + 0.5)
    2. y = (int) (x + 0.5)
    3. y = (int) x + 0.5
    4. y = (int) ((int)x + 0.5)                    Answer : B
  3. Which of the following has compilation error in C?
    1. int n = 32;
    2. char ch = 65;
    3. float f = (float) 3.2;
    4. None of the above                      Answer : D
  4. What is default storage class of variables in C language?
    1. extern
    2. local
    3. auto
    4. global                                     Answer : C
  5. Representation of data structure in memory is known as
    1. Recursive
    2. Abstract data type
    3. Storage structure
    4. File structure                         Answer : B
  6. Which of the following search algorithm requires a sorted array?
    1. Linear search
    2. Hash search
    3. Binary search
    4. All of these                           Answer : C
  7. The largest element of an array index is called its
    1. Lower bound
    2. Upper bound
    3. Range
    4. All of the above                        Answer : B
  8. Which of the following is a Compound assignment operators?
    1. +=
    2. *=
    3. /=
    4. All the above                                Answer : D

Previous

Next

 

Related posts

Leave a Comment

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

Scroll to Top
%d bloggers like this: