

MCQOPTIONS
Saved Bookmarks
This section includes 1331 Mcqs, each offering curated multiple-choice questions to sharpen your Technical Programming knowledge and support exam preparation. Choose a topic below to get started.
1151. |
If the variables i, j and k are assigned the values 5,3 and 2 respectively, then the expression i = j + ( k + + = 6 ) + 7 |
A. | gives an error message |
B. | assigns a value 16 to i |
C. | assigns a value 18 to i |
D. | assigns a value 19 to i |
Answer» B. assigns a value 16 to i | |
1152. |
In multi-list organization .................. |
A. | records that have equivalent value for a given secondary index item are linked together to form a list. |
B. | records are loaded in ordered sequence defined by collating sequence by content of the key |
C. | records are directly accessed by record key field |
D. | records are directly accessed without record key field |
Answer» B. records are loaded in ordered sequence defined by collating sequence by content of the key | |
1153. |
If ‘y’ is of integer type then the expressions 3* (y − 8)/9 and (y − 8)/9 * 3 |
A. | must yield the same value. |
B. | must yield different values. |
C. | may or may not yield the same value. |
D. | none of the above. |
Answer» D. none of the above. | |
1154. |
The conditional compilation ................ |
A. | is taken care of by the compiler |
B. | is setting the compiler option conditionally |
C. | is compiling a program based on a condition |
D. | none of the above |
Answer» D. none of the above | |
1155. |
The code ifstream fin; would be used when .................. |
A. | creating a file |
B. | reading a file |
C. | appending a file |
D. | removing a file |
Answer» C. appending a file | |
1156. |
The continue statement .................. |
A. | resumes the program if it is hanged |
B. | resumes the program if it was break was applied |
C. | skips the rest of the loop in current iteration |
D. | executes the entire iteration |
Answer» D. executes the entire iteration | |
1157. |
The function ftell () |
A. | reads a character from a file |
B. | reads an integer from a file |
C. | gives the current position in the file |
D. | sets the position to the beginning of the file. |
Answer» D. sets the position to the beginning of the file. | |
1158. |
If x is one dimensional array, then pick up the correct answer |
A. | *(x + i) is same as &x[i] |
B. | *&x[i] is same as x + i |
C. | *(x + i) is same as x[i] +1 |
D. | *(x + i) is same as *x[i] |
Answer» B. *&x[i] is same as x + i | |
1159. |
The file iostream includes ................ |
A. | the declarations of the basic standard input-output library. |
B. | the streams of includes and outputs of program effect. |
C. | both of these |
D. | none of these. |
Answer» B. the streams of includes and outputs of program effect. | |
1160. |
What punctuation is used to signal the beginning and end of code blocks? |
A. | { } |
B. | -> and <- |
C. | BEGIN and END |
D. | ( and ) |
Answer» B. -> and <- | |
1161. |
What will be the output of the following statement? printf( 3 + "goodbye"); |
A. | goodbye |
B. | odbyedbye |
C. | dbye |
D. | bye |
Answer» D. bye | |
1162. |
What will be the output of the following arithmetic expression? 5+3*2%10-8*6 |
A. | -34 |
B. | -37 |
C. | -66 |
D. | -24 |
Answer» C. -66 | |
1163. |
Recursion is sometimes called .................. |
A. | Circular definition |
B. | Complex definition |
C. | Procedure |
D. | Union |
Answer» B. Complex definition | |
1164. |
A self contained block of statements that perform a coherent task of some kind is called a .................... |
A. | Monitor |
B. | Function |
C. | Program |
D. | Structure |
Answer» C. Program | |
1165. |
C language has been developed by .................. |
A. | Ken Thompson |
B. | Dennis Ritchie |
C. | Peter Norton |
D. | Martin Richards |
Answer» C. Peter Norton | |
1166. |
When writing comments you can ................... |
A. | use code and /* comment on the same line. |
B. | use code and // comments on the same line. |
C. | use code and //* comments on the same line. |
D. | use code and <!- comments on the same line. |
Answer» C. use code and //* comments on the same line. | |
1167. |
Which of the following statement is true about preprocessor directives? |
A. | these are lines read and processed by the pre-processor. |
B. | these are lines read and processed by the pre-processor. |
C. | these must be written on their own line. |
D. | they end with a semicolon. |
Answer» E. | |
1168. |
What punctuation ends most lines of C++ code? |
A. | . (dot) |
B. | ; (semi-colon) |
C. | : (colon) |
D. | (single quote) |
Answer» C. : (colon) | |
1169. |
The ............... access specifier allows functions or data to be accessible to other parts of the program. |
A. | private |
B. | protected |
C. | public |
D. | inherited |
Answer» D. inherited | |
1170. |
Public, private, protected are ................. |
A. | identifiers |
B. | keywords |
C. | access specifiers |
D. | type of class |
Answer» D. type of class | |
1171. |
An ................. is an instance of class. |
A. | class |
B. | object |
C. | variable |
D. | variable |
Answer» C. variable | |
1172. |
In the for statement: for (exp1; exp2; exp3) { … } where exp1, exp2 and exp3 are expressions. What is optional? |
A. | None of the expressions is optional. |
B. | Only exp1 is optional. |
C. | Only exp1 and exp3 are optional. |
D. | All the expressions are optional. |
Answer» E. | |
1173. |
When a data type must contain decimal numbers, the data type assigned is ................ |
A. | int |
B. | char |
C. | double |
D. | long int |
Answer» D. long int | |
1174. |
Hierarchy decides which operator .............. |
A. | is most important |
B. | is used first |
C. | is fastest |
D. | operates on largest numbers |
Answer» E. | |
1175. |
The expression x = 4 + 2 % - 8 evaluates to |
A. | -6 |
B. | 6 |
C. | 4 |
D. | None of the above |
Answer» C. 4 | |
1176. |
Array indexing always starts with the number ................. |
A. | 0 |
B. | 1 |
C. | a |
D. | 0 |
Answer» B. 1 | |
1177. |
Which of the following identifiers is invalid? |
A. | papername |
B. | writername |
C. | typename |
D. | printname |
Answer» D. printname | |
1178. |
Which of the following can not be used as identifiers? |
A. | letters |
B. | digits |
C. | underscores |
D. | spaces |
Answer» E. | |
1179. |
The library function isalpha( ) requires the header file ................ |
A. | <ctype.h> |
B. | <math.h> |
C. | <time.h> |
D. | <stdlib.h> |
Answer» B. <math.h> | |
1180. |
Which is not dynamic memory allocation function? |
A. | malloc |
B. | free |
C. | alloc |
D. | calloc |
Answer» D. calloc | |
1181. |
When using a built-in function, you must ................ |
A. | include the functions prototype |
B. | include the proper header file |
C. | include the functions definition |
D. | specify the length of the library function |
Answer» E. | |
1182. |
What is the output of the following program segment ? main() { long i = 65536; printf(“%d\n”, i); } |
A. | 0 |
B. | 65536 |
C. | -1 |
D. | 65 |
Answer» B. 65536 | |
1183. |
An array of pointers is same as ................. |
A. | pointer to array |
B. | pointers to pointers |
C. | pointer to function |
D. | pointer to structure |
Answer» C. pointer to function | |
1184. |
............... operator links a class to a member. |
A. | :: |
B. | . |
C. | -> |
D. | * |
Answer» B. . | |
1185. |
What is the following program doing? main () { int d = 1; do printf(“%d\n”, d++); while (d < = 9);} |
A. | Adding 9 integers |
B. | Adding integers from 1 to 9 |
C. | Displaying integers from 1 to 9 |
D. | None of these |
Answer» D. None of these | |
1186. |
The valid octal constants from the following (i) 0245 (ii) 0387 (iii) 04.32 (iv) -0467 |
A. | (i) and (ii) |
B. | (iii) and (iv) |
C. | (ii) and (iii) |
D. | (i) and (iv) |
Answer» E. | |
1187. |
The void type is used for |
A. | Returning the value |
B. | creating generic pointers |
C. | Creating functions |
D. | Avoid error |
Answer» C. Creating functions | |
1188. |
The output of the following statements is char ch[6]={‘e’, ‘n’, ‘d’, ‘\0’, ‘p’}; printf(“%s”, ch); |
A. | endp |
B. | end0p |
C. | end |
D. | error |
Answer» D. error | |
1189. |
Variables that are declared, but not initialized, contain ................ |
A. | blank spaces |
B. | zeros |
C. | "garbage" values |
D. | nothing - they are empty |
Answer» D. nothing - they are empty | |
1190. |
.............. provides multiway branching. |
A. | for |
B. | if |
C. | if else |
D. | Switch |
Answer» E. | |
1191. |
Which of the following is not an escape sequence? |
A. | |
B. | |
C. | ’ |
D. | p |
Answer» E. | |
1192. |
The size of array int a[5]={1,2} is |
A. | 4 |
B. | 12 |
C. | 10 |
D. | 6 |
Answer» D. 6 | |
1193. |
What would be returned by the following recursive function after we call test (0, 3) int test (int a, int b) { if (a==b) return (1); else if (a>b) return(0); else return (a+test(a+1, b)); } |
A. | 1 |
B. | 2 |
C. | 3 |
D. | 4 |
Answer» E. | |
1194. |
A structure pointer points to an/a .................. of its structure type. |
A. | variable |
B. | address |
C. | keyword |
D. | instance |
Answer» E. | |
1195. |
Identify the correct statement regarding scope of variables. |
A. | Global variables are declared in a separate file and accessible from any program. |
B. | Local variables are declared inside a function and accessible within the function only. |
C. | Global variables are declared inside a function and accessible from anywhere in program. |
D. | Local variables are declared in the main body of the program and accessible only from functions. |
Answer» C. Global variables are declared inside a function and accessible from anywhere in program. | |
1196. |
The ............... operator is used to return the value of the variable to which the pointer points. |
A. | reference |
B. | dereference |
C. | dot |
D. | dot |
Answer» C. dot | |
1197. |
................. operator returns the address of the identifier. |
A. | & |
B. | * |
C. | && |
D. | ! |
Answer» B. * | |
1198. |
The ............... is the variables that contain the address of other variables. |
A. | function |
B. | string |
C. | pointer |
D. | identifier |
Answer» D. identifier | |
1199. |
A ............... is a variable that receives the value. |
A. | argument |
B. | parameter |
C. | variable |
D. | array |
Answer» C. variable | |
1200. |
The ............... term refers to the value that is used to call a function. |
A. | parameter |
B. | argument |
C. | variable |
D. | pointer |
Answer» C. variable | |