

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.
1201. |
What is a Constructor? |
A. | A function called when an instance of a class is initialized. |
B. | A function that is called when an instance of a class is deleted. |
C. | A special function to change the value of dynamically allocated memory. |
D. | A function that is called in order to change the value of a variable. |
Answer» B. A function that is called when an instance of a class is deleted. | |
1202. |
What will be the output of the following program ? main() { char *p = “ayqm”; printf (“%c”, ++*(p++));} |
A. | b |
B. | z |
C. | q |
D. | n |
Answer» B. z | |
1203. |
Output of the program given below is int i; main() { printf(“%d”, i); } |
A. | 1 |
B. | 0 |
C. | -1 |
D. | Null |
Answer» C. -1 | |
1204. |
What is the output of the following program segment? main() { int i = ++2; printf(“%d\n”, i); } |
A. | 3 |
B. | 2 |
C. | 0 |
D. | -1 |
Answer» B. 2 | |
1205. |
What is the output of the following program segment? main() { int i = 1; do { printf(“%d..”, i); } while(i--); } |
A. | 0..1.. |
B. | 1..0.. |
C. | 0 |
D. | -1 |
Answer» C. 0 | |
1206. |
What is the output of the following program? main ( ) { extern int x; x = 20; printf(“\n%d”, x); } |
A. | 0 |
B. | 20 |
C. | error |
D. | garbage value |
Answer» D. garbage value | |
1207. |
The conditional expressions are evaluated from ............. |
A. | top down |
B. | bottom up |
C. | middle |
D. | end |
Answer» B. bottom up | |
1208. |
If and the switch statements are called as ................. statements. |
A. | iteration |
B. | jump |
C. | selection |
D. | conditional |
Answer» D. conditional | |
1209. |
Latency time is ................... |
A. | time taken by read/write head mechanism to position itself over appropriate cylinder |
B. | time taken to transfer a data from memory |
C. | time taken by appropriate sector to come under read/write head |
D. | time taken to retrieve the data |
Answer» D. time taken to retrieve the data | |
1210. |
Seek time is ............... |
A. | time taken to retrieve a data |
B. | ) time taken by read/write head mechanism to position itself over appropriate cylinder |
C. | time taken by appropriate sector to come under read/write |
D. | time taken to find out the data |
Answer» C. time taken by appropriate sector to come under read/write | |
1211. |
Each object has its own copies of the class ................. |
A. | data |
B. | code |
C. | function |
D. | instance variables |
Answer» E. | |
1212. |
................ operator links the name of the object with the name of the member. |
A. | -> |
B. | .(Dot) |
C. | & |
D. | * |
Answer» C. & | |
1213. |
Code is contained in .............. of the class. |
A. | object |
B. | template |
C. | function |
D. | array |
Answer» D. array | |
1214. |
The ............. statements are simply a group of related statements that are treated as a single unit. |
A. | block |
B. | multiple |
C. | related |
D. | logical |
Answer» B. multiple | |
1215. |
What is the output of the following program? main( ) { int i=4, z=12; if(i=5 || z>50) printf(“hello”); else printf(“hye”); } |
A. | hello |
B. | hye |
C. | syntax error |
D. | hellohye |
Answer» B. hye | |
1216. |
Which of the following statement is true about a function? |
A. | An invoking function must pass arguments to the invoked function. |
B. | Every function returns a value to the invoker. |
C. | A function may contain more than one return statement. |
D. | Every function must be defined in its own separate file. |
Answer» B. Every function returns a value to the invoker. | |
1217. |
The given FOR loop is for ( ; ; ) { printf(“ ”); } |
A. | valid |
B. | indefinite |
C. | invalid |
D. | displays runtime errors |
Answer» E. | |
1218. |
C language was invented by |
A. | Abacus |
B. | Charles babage |
C. | Thomson |
D. | Dennis Ritchie |
Answer» E. | |
1219. |
The function that allocates requested size of bytes and returns a pointer to the first byte of the allocated space is: |
A. | realloc |
B. | malloc |
C. | calloc |
D. | none of the above |
Answer» C. calloc | |
1220. |
Which of the following is not a valid escape code? |
A. | |
B. | v |
C. | f |
D. | w |
Answer» E. | |
1221. |
Which of the following is the proper keyword to deallocate memory? |
A. | free |
B. | delete |
C. | clear |
D. | remove |
Answer» B. delete | |
1222. |
Which of the following is the proper keyword to allocate memory? |
A. | new |
B. | malloc |
C. | create |
D. | value |
Answer» C. create | |
1223. |
The escape sequence \o represents ................ |
A. | back space |
B. | new line |
C. | octal number |
D. | hexadecimal number |
Answer» D. hexadecimal number | |
1224. |
Which of the following is not true about constants in c++? |
A. | It is also called literals |
B. | It has not compiled place in memory |
C. | It s value cannot be changed |
D. | ) The address value cannot be of constant data type |
Answer» E. | |
1225. |
................ object is used to print wide characters. |
A. | wout |
B. | |
C. | w_cout |
D. | cout |
Answer» B. print | |
1226. |
The ................ is contained in instance variable defined by the class. |
A. | data |
B. | code |
C. | object |
D. | Function |
Answer» B. code | |
1227. |
The code and data are called ................ of the class. |
A. | instances |
B. | instance variables |
C. | members |
D. | object |
Answer» D. object | |
1228. |
.................... is the data type that can accommodate char that require more than 8-bits |
A. | char |
B. | wchar_t |
C. | w char |
D. | char_t |
Answer» C. w char | |
1229. |
What is the output of the following program? main ( ) { int x = 2, y = 5; if (x < y) return (x = x+y); else printf (“z1”); printf(“z2”); } |
A. | z2 |
B. | z1z2 |
C. | Compilation error |
D. | None of these |
Answer» E. | |
1230. |
A .................. is a storage location that contains data value. |
A. | function |
B. | structure |
C. | variable |
D. | key word |
Answer» D. key word | |
1231. |
The ................... is predefined identifier that is linked to console output |
A. | out |
B. | |
C. | cin |
D. | cout |
Answer» E. | |
1232. |
Which of the following is one of the international keyword? |
A. | Int |
B. | Bitand |
C. | try |
D. | While |
Answer» C. try | |
1233. |
The name of a function variable or class is called ................... |
A. | libraries |
B. | stream |
C. | identifiers |
D. | keywords |
Answer» D. keywords | |
1234. |
................. in a program source code, documents the meaning of the code. |
A. | comment |
B. | function |
C. | class |
D. | main function |
Answer» B. function | |
1235. |
C++ begins its execution with ................ |
A. | header file |
B. | main |
C. | class |
D. | declaration |
Answer» C. class | |
1236. |
The commonly used term for a sub routine in c++ is ............... |
A. | structure |
B. | class |
C. | function |
D. | program |
Answer» D. program | |
1237. |
A joint ANSI /ISO committee was formed in ................ to define standard C++. |
A. | 1986 |
B. | 1987 |
C. | 1988 |
D. | 1989 |
Answer» E. | |
1238. |
The ............... is the standard input/ouput library in C++. |
A. | stdio |
B. | iostream |
C. | conio |
D. | std |
Answer» C. conio | |
1239. |
C++ was developed by............. |
A. | Dr. Bjarne stroustrup |
B. | Dennis Ritc |
C. | Borland |
D. | ANSI |
Answer» B. Dennis Ritc | |
1240. |
To rethrow an exception .................. is specified. |
A. | throw without a value |
B. | catch with a value |
C. | rethrow |
D. | catch without a value |
Answer» B. catch with a value | |
1241. |
The .................. is a short function that gets or sets the value of a private instance variable. |
A. | inline |
B. | friend |
C. | accessor |
D. | void |
Answer» D. void | |
1242. |
The ............. manipulator skips leading whitespaces. |
A. | sw |
B. | ws |
C. | wy |
D. | skipws |
Answer» C. wy | |
1243. |
The second element of the array int zones[5]= { 43,54,56,76,78} can be accessed by ................. |
A. | zones[2] |
B. | zones[1] |
C. | zones[3] |
D. | zones[4] |
Answer» C. zones[3] | |
1244. |
The elements of an array can be accessed by providing integer expression called ............... |
A. | superscripts |
B. | elements |
C. | values |
D. | subscripts |
Answer» E. | |
1245. |
The ............... is the function that detects the end of file. |
A. | eof() |
B. | getline() |
C. | putline() |
D. | clear() |
Answer» B. getline() | |
1246. |
The current position of each file pointer using the functions ............... and ............... |
A. | pos_type tellg(), pos_type tellp() |
B. | pos_type tellx(), pos_type tellf() |
C. | pos_type tellx(), pos_type tellp() |
D. | pos_type tellf(), pos_type tellp() |
Answer» B. pos_type tellx(), pos_type tellf() | |
1247. |
................... determines the type of an object at the runtime. |
A. | Static |
B. | Dynamic |
C. | Typeid |
D. | Typedef |
Answer» D. Typedef | |
1248. |
The ............... keyword brings the members of a namespace into view. |
A. | view |
B. | using |
C. | additive |
D. | show |
Answer» C. additive | |
1249. |
If an allocation request is not fulfilled ................... exception is thrown. |
A. | wrong_alloc |
B. | re_alloc |
C. | malloc |
D. | bad_alloc |
Answer» E. | |
1250. |
The keyword ................ is used to declare a generic function. |
A. | generic |
B. | template |
C. | virtual |
D. | friend |
Answer» C. virtual | |