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.
| 951. |
What will be the output of following program ? main() { int x=15; printf(“\n%d%d%d”, x!=15, x=20, x |
| A. | 0, 20, 1 |
| B. | 15, 20, 30 |
| C. | 0, 0, 0 |
| D. | Error |
| Answer» B. 15, 20, 30 | |
| 952. |
The expression X=4+2%-8 evaluates |
| A. | -6 |
| B. | 6 |
| C. | 4 |
| D. | None |
| Answer» C. 4 | |
| 953. |
The maximum value that an integer constant can have is |
| A. | .32767 |
| B. | 32767 |
| C. | 1.7014e+38 |
| D. | –1.7014e+38 |
| Answer» C. 1.7014e+38 | |
| 954. |
Determine which of the following is a valid character constant |
| A. | ‘’ |
| B. | ‘0’ |
| C. | ‘xyz’ |
| D. | ‘052’ |
| Answer» B. ‘0’ | |
| 955. |
What will be the output of the following program ? main() { int i = 5; printf(“%d”, i=++i==6); } |
| A. | 0 |
| B. | 1 |
| C. | 7 |
| D. | 6 |
| Answer» C. 7 | |
| 956. |
Set of values of the same type, which have a single name followed by an index is called |
| A. | function |
| B. | structure |
| C. | array |
| D. | union |
| Answer» D. union | |
| 957. |
The C language includes the header file standard input & output in |
| A. | stdlib.h library |
| B. | stdio.h library |
| C. | conio.h library |
| D. | #include library |
| Answer» C. conio.h library | |
| 958. |
The |
| A. | Right shifting |
| B. | Left shifting |
| C. | Bitwise shifting |
| D. | Bitwise complement |
| Answer» C. Bitwise shifting | |
| 959. |
main() { printf(“%p\n”, main()); } |
| A. | Prints the address of main function |
| B. | Prints 0 |
| C. | Is an error |
| D. | Is an infinite loop |
| Answer» B. Prints 0 | |
| 960. |
What is the error in the following code? class t { virtual void print(); } |
| A. | No error. |
| B. | Function print() should be declared as static. |
| C. | Function print() should be defined. |
| D. | Class t should contain data members. |
| Answer» B. Function print() should be declared as static. | |
| 961. |
What would be the output of the following program? int main() { int x,y=10,z=10; x = (y = = z); cout |
| A. | 1 |
| B. | 0 |
| C. | 10 |
| D. | Error |
| Answer» B. 0 | |
| 962. |
Which of the following declarations are illegal? |
| A. | void *ptr; |
| B. | char *str = “hello”; |
| C. | char str = “hello”; |
| D. | Const *int p1 |
| Answer» D. Const *int p1 | |
| 963. |
If we store the address of a derived class object into a variable whose type is a pointer to the base class, then the object, when accessed using this pointer. |
| A. | continues to act like a derived class object. |
| B. | Continues to act like a derived class object if virtual functions are called. |
| C. | Acts like a base class object. |
| D. | Acts like a base class, if virtual functions are called. |
| Answer» C. Acts like a base class object. | |
| 964. |
A pointer variable can be |
| A. | passed to a function as argument |
| B. | changed within function |
| C. | returned by a function |
| D. | assigned an integer value |
| Answer» D. assigned an integer value | |
| 965. |
The following program fragment int *a; *a = 7; |
| A. | assigns 7 to a |
| B. | results in compilation error |
| C. | assigns address of a as 7 |
| D. | segmentation fault |
| Answer» E. | |
| 966. |
Consider the following program main ( ) { float a = 0.5, b = 0.7; if (b < 0.8) if (a < 0.5) printf (“ABCD”); else printf (“PQR”); else printf (“JKLF); } The output is |
| A. | ABCD |
| B. | PQR |
| C. | JKLF |
| D. | None of these |
| Answer» C. JKLF | |
| 967. |
The value of an automatic variable that is declared but not initialised will be |
| A. | 0 |
| B. | -1 |
| C. | unpredictable |
| D. | none of these |
| Answer» D. none of these | |
| 968. |
Output of the following program fragment is x = 5; y = x++; printf(“%d%d”, x, y); |
| A. | 5,6 |
| B. | 5,5 |
| C. | 6,5 |
| D. | 6,6 |
| Answer» D. 6,6 | |
| 969. |
printf (“%d”, printf (“tim”)); |
| A. | results in a syntax error |
| B. | outputs tim3 |
| C. | outputs garbage |
| D. | outputs tim and terminates abruptly |
| Answer» C. outputs garbage | |
| 970. |
Which one of the following special symbols is allowed in a variable name? |
| A. | | (pipeline) |
| B. | * (asterisk) |
| C. | - (hyphen) |
| D. | _ (underscore) |
| Answer» E. | |
| 971. |
The number of elements in a 2-D array a [-5..5, 5..10] is |
| A. | 44 |
| B. | 55 |
| C. | 66 |
| D. | 77 |
| Answer» D. 77 | |
| 972. |
Which of the following c operators has the highest precedence? |
| A. | ++ |
| B. | % |
| C. | Ü |
| D. | && |
| Answer» B. % | |
| 973. |
Only the address of the object is transferred to the function |
| A. | Pass-by-reference |
| B. | Pass-by-pointer |
| C. | Pass-by-value |
| D. | None of the above |
| Answer» B. Pass-by-pointer | |
| 974. |
A stream is a sequence of |
| A. | Integers |
| B. | File names |
| C. | Bytes |
| D. | Classes |
| Answer» D. Classes | |
| 975. |
Consider the statements a = 13 ; c = a |
| A. | 104 |
| B. | 114 |
| C. | 140 |
| D. | 14 |
| Answer» B. 114 | |
| 976. |
When a copy of an entire object is passed to a function, then it is referred to as |
| A. | Pass-by-reference |
| B. | Pass-by-pointer |
| C. | Pass-by-value |
| D. | None of the above |
| Answer» D. None of the above | |
| 977. |
In C, Arithmetic instruction cannot contain .............. |
| A. | variables |
| B. | constants |
| C. | variable names on right side of = |
| D. | constants on left side of = |
| Answer» E. | |
| 978. |
Which of the following is FALSE in C ? |
| A. | Keywords can be used as variable names |
| B. | Variable names can contain a digit |
| C. | Variable names do not contain a blank space |
| D. | Capital letters can be used in variable names |
| Answer» B. Variable names can contain a digit | |
| 979. |
In C a variable cannot contain |
| A. | Blank spaces |
| B. | Hyphen |
| C. | Decimal point |
| D. | All the above |
| Answer» E. | |
| 980. |
Consider the following statements char *ptr; ptr = “hello”; cout |
| A. | first letter |
| B. | entire string |
| C. | it is a syntax error |
| D. | last letter |
| Answer» B. entire string | |
| 981. |
Identify the operator that is NOT used with pointers |
| A. | -> |
| B. | & |
| C. | * |
| D. | >> |
| Answer» E. | |
| 982. |
A virtual class is the same as |
| A. | an abstract class |
| B. | a class with a virtual function |
| C. | a base class |
| D. | none of the above. |
| Answer» E. | |
| 983. |
An exception is caused by |
| A. | a hardware problem |
| B. | a problem in the operating system |
| C. | a syntax error |
| D. | a run-time error |
| Answer» E. | |
| 984. |
Consider the following statements: int x = 22,y=15; x = (x>y) ? (x+y) : (x-y); What will be the value of x after executing these statements? |
| A. | 22 |
| B. | 37 |
| C. | 7 |
| D. | Error. Cannot be executed |
| Answer» C. 7 | |
| 985. |
The new operator |
| A. | returns a pointer to the variable |
| B. | creates a variable called new |
| C. | obtains memory for a new variable |
| D. | tells how much memory is availabl |
| Answer» D. tells how much memory is availabl | |
| 986. |
The expression, a = 7 / 22 * ( 3.14 + 2 ) * 3 / 5 ; evaluates to |
| A. | 8.28 |
| B. | 6.28 |
| C. | 3.14 |
| D. | 0 |
| Answer» E. | |
| 987. |
A character variable can at a time store: |
| A. | 1 character |
| B. | 8 characters |
| C. | 254 characters |
| D. | None of the above |
| Answer» B. 8 characters | |
| 988. |
The real constant in C can be expressed in which of the following forms ? |
| A. | Fractional form only |
| B. | Exponential form only |
| C. | ASCII form only |
| D. | Both fractional and exponential forms |
| Answer» E. | |
| 989. |
C programs are converted into machine language with the help of .............. |
| A. | An Editor |
| B. | A compiler |
| C. | An operating system |
| D. | None of the above |
| Answer» C. An operating system | |
| 990. |
C can be used on ................ |
| A. | Only MS-DOS operating system |
| B. | Only Linux operating system |
| C. | Only Windows operating system |
| D. | All the above |
| Answer» E. | |
| 991. |
Consider the following code segment: int a[10], *p1, *p2; p1 = &a[4]; p2 = &a[6]; Which of the following statements is incorrect w.r.t. pointers? |
| A. | p1 + 2 |
| B. | p2 – 2 |
| C. | p2 + p1 |
| D. | p2 – p1 |
| Answer» D. p2 – p1 | |
| 992. |
When using atoi() with an ap string variable ................... |
| A. | you must convert the apstring to a standard string by using .c_str( ) |
| B. | all numbers within the string will be converted to integers |
| C. | all characters within the string will be converted to ASCII equivalents |
| D. | all alphabetic characters within the string will be counted |
| Answer» B. all numbers within the string will be converted to integers | |
| 993. |
Block statements are also called as .................. statements. |
| A. | group |
| B. | multiple |
| C. | compound |
| D. | logical |
| Answer» D. logical | |
| 994. |
The ............... in C++ is unconditional jump statement. |
| A. | goto |
| B. | jump |
| C. | next |
| D. | go |
| Answer» B. jump | |
| 995. |
The ................... statement causes immediate termination of the loop. |
| A. | stop |
| B. | exit |
| C. | break |
| D. | jump |
| Answer» D. jump | |
| 996. |
Value of ix+j, if i,j are integer type and ix long type would be .................. |
| A. | integer |
| B. | float |
| C. | long integer |
| D. | double precision |
| Answer» D. double precision | |
| 997. |
Literal means |
| A. | a string |
| B. | a string constant |
| C. | a character |
| D. | an alphabet |
| Answer» C. a character | |
| 998. |
Choose the directive that is used to remove previously defined definition of the macro name that follows it: |
| A. | # remdef |
| B. | # pragma |
| C. | # undef |
| D. | # define |
| Answer» D. # define | |
| 999. |
Which amongst the following expression uses bitwise operator? |
| A. | a++ |
| B. | !a>5 |
| C. | a|b |
| D. | a!=b |
| Answer» D. a!=b | |
| 1000. |
The two types of file structure existing in VSAM file are ................ |
| A. | key sequenced structure, entry sequenced structure |
| B. | key sequence structure, exit sequenced structure |
| C. | entry sequence structure, exit sequenced structure |
| D. | sequential, random |
| Answer» D. sequential, random | |