Programming For Problem Solving Set 4
On This Page
This set of Programming for Problem Solving Multiple Choice Questions & Answers (MCQs) focuses on Programming For Problem Solving Set 4
Q1 | What is maximum dimension that array can have in c programming?
- 2
- 4
- Theoretically No Limit but practically limit depends on memory
- 3
Q2 | Array with last element 'n' will always have array size equal to _______.
- n+1
- n-1
- n+n
- n
Q3 | Array is an example of _______ type memory allocation.
- Compile Time
- Run Time
- none
- all
Q4 | Array is ______ data type in C Programming language.
- Custom Data Type
- Primitive Data Type
- None of these
- Derived Data Type
Q5 | A Pointer to a block of memory is considered same as an array.
- NO
- YES
- none
- all
Q6 | What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?
- The element will be set to 0.
- The compiler would report an error.
- The array size would appropriately grow.
- The program may crash if some important data gets overwritten.
Q7 | If you pass an array as an argument to a function, what actually gets passed?
- Base address of the array
- Value of elements in array
- First element of the array
- Address of the last element of array
Q8 | Pointer is special kind of variable which is used to store __________ of the variable.
- Address
- Value
- Variable Name
- Data Type
Q9 | Pointer variable is declared using preceding _________ sign.
- ^
- *
- &
- %
Q10 | Address stored in the pointer variable is of type __________.
- Integer
- Array
- Floating
- Character
Q11 | Consider the 32 bit compiler. We need to store address of integer variable to integer pointer. What will be the size of integer pointer?
- 10 Bytes
- 4 Bytes
- 2 Bytes
- 6 Bytes
Q12 | In order to fetch the address of the variable we write preceding _________ sign before variable name.
- Asteriks
- Percent
- Comma
- Ampersand
Q13 | 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 }
Q14 | 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 -->
Q15 | What is true about fputs function
- write to a file
- takes two parameters
- requires a file pointer
- all of above
Q16 | Wild pointer in C
- if pointer is pointing to a memory location from where variable has been deleted
- if pointer has not been initialized
- if pointer has not defined properly
- if pointer pointing to more than one variable
Q17 | Any type of modification on the parameter inside the function will reflect in actual variable value can be related to..
- call by value
- call by reference
- both of above
- none of above
Q18 | Size of void pointer is
- 1 byte
- 2 byte
- 3 byte
- 4 byte
Q19 | To print a single character in ouptut,which function is used?
- getchar()
- gets()
- putchar()
- puts()
Q20 | #define t 10void main(){printf("%d",t);}
- 10
- Error:Unfined symbol 't'
- Error:Improper placement of preprocessor
- none of the above
Q21 | Explicit data type conversion is called
- Type casting
- conversion
- separation
- none
Q22 | which of these is not a valid character constant
- “A”
- ‘A’
- “*”
- “+”
Q23 | If 'a' is the integer which is not statically initialized then what is the value of 'a'?
- zero
- garbage
- none of these
- One
Q24 | C is a ____________________ language
- Platform independent programming
- Platform dependent programming
- Object oriented programming
- None of the above.
Q25 | In a function call, _____________ is passed as arguments.
- variables
- constants
- Expressions
- All the above