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