Scroll to Top

Arrays | Arrays Initialization- C Questions(Previous Year)-8

Technical Placement Questions(Previous Year)-8

 

Arrays | Arrays Initialization- C Questions

 

C Questions

 

  1. Bitwise operators can operate upon?
    1. double and chars
    2. floats and doubles
    3. ints and floats
    4. ints and chars                               Answer : D
  2. perror( ) function used to ?
    1. Work same as printf()
    2. prints the error message specified by the compiler
    3. prints the garbage value assigned by the compiler
    4. None of the above                       Answer : B
  3. What is the right way to access value of structure variable book{ price, page }?
    1. printf(“%d%d”, book.price, book.page);
    2. printf(“%d%d”, price.book, page.book);
    3. printf(“%d%d”, price::book, page::book);
    4. printf(“%d%d”, price->book, page->book);                  Answer : A
  4. An array elements are always stored in _________ memory locations.
    1. Sequential
    2. Random
    3. Sequential and Random
    4. None of the above                            Answer : A
  5. What is right way to Initialization array?
    1. int num[6] = { 2, 4, 12, 5, 45, 5 } ;
    2. int n{} = { 2, 4, 12, 5, 45, 5 } ;
    3. int n{6} = { 2, 4, 12 } ;
    4. int n(6) = { 2, 4, 12, 5, 45, 5 } ;                       Answer : A
  6. What is an array?
    1. An array is a collection of variables that are of the dissimilar data type.
    2. An array is a collection of variables that are of the same data type.
    3. An array is not a collection of variables that are of the same data type.
    4. None of the above.                          Answer : B
  7. Which of the following shows the correct hierarchy of arithmetic operations in C
    1. / + * –
    2. * – / +
    3. + – / *
    4. * / + –                            Answer : D
  8. Which of the following is allowed in a C Arithmetic instruction
    1. []
    2. {}
    3. ()
    4. None of the above                     Answer : C

Previous Page

Next Page

 

Related posts

Leave a Comment

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

Scroll to Top
%d bloggers like this: