

MCQOPTIONS
This section includes 564 Mcqs, each offering curated multiple-choice questions to sharpen your Engineering knowledge and support exam preparation. Choose a topic below to get started.
501. |
Is the NULL pointer same as an uninitialised pointer? |
A. | Yes |
B. | No |
Answer» C. | |
502. |
Will the program compile in Turbo C?
|
A. | Yes |
B. | No |
Answer» C. | |
503. |
Will the following program give any warning on compilation in TurboC (under DOS)?
|
A. | Yes |
B. | No |
Answer» C. | |
504. |
Which of the following statements correctly declare a function that receives a pointer to pointer to a pointer to a float and returns a pointer to a pointer to a pointer to a pointer to a float? |
A. | float **fun(float***); |
B. | float *fun(float**); |
C. | float fun(float***); |
D. | float ****fun(float***); |
Answer» E. | |
505. |
Which of the following are correct preprocessor directives in C?
|
||||||||
A. | 1, 2 | ||||||||
B. | 4 | ||||||||
C. | 1, 2, 4 | ||||||||
D. | 1, 2, 3, 4 | ||||||||
Answer» E. | |||||||||
506. |
Which of the following are correctly formed #define statements in C? |
A. | #define CUBE (X) (X*X*X); |
B. | #define CUBE(x) (X*X*X) |
C. | #define CUBE(X)(X*X*X) |
D. | #define CUBE(X) {X*X*X} |
Answer» D. #define CUBE(X) {X*X*X} | |
507. |
If the file to be included doesn't exist, the preprocessor flashes an error message. |
A. | True |
B. | False |
Answer» B. False | |
508. |
There exists a way to prevent the same file from getting #included twice in the same program. |
A. | True |
B. | False |
Answer» B. False | |
509. |
A preprocessor directive is a message from programmer to the preprocessor. |
A. | True |
B. | False |
Answer» B. False | |
510. |
Is there any difference between the two statements? |
A. | Yes |
B. | No |
Answer» B. No | |
511. |
Will the following code work?
|
A. | Yes |
B. | No |
Answer» B. No | |
512. |
A pointer union CANNOT be created |
A. | Yes |
B. | No |
Answer» C. | |
513. |
For the following statements will arr[3] and ptr[3] fetch the same character? |
A. | Yes |
B. | No |
Answer» B. No | |
514. |
Will the program compile successfully?
|
A. | Yes |
B. | No |
Answer» C. | |
515. |
What will be the output of the program under DOS?
|
A. | 4, 4, 4 |
B. | 4, 2, 2 |
C. | 2, 8, 4 |
D. | 2, 4, 8 |
Answer» C. 2, 8, 4 | |
516. |
What will be the output of the program (sample.c) given below if it is executed from the command line (Turbo C in DOS)?
|
A. | 6 |
B. | sample 6 |
C. | Error |
D. | Garbage value |
Answer» D. Garbage value | |
517. |
What will be the output of the program?
|
A. | Result = -100.000000 |
B. | Result = -25.000000 |
C. | Result = 0.000000 |
D. | Result = 100.000000 |
Answer» B. Result = -25.000000 | |
518. |
In Turbo C/C++ under DOS if we want that any wild card characters in the command-line arguments should be appropriately expanded, are we required to make any special provision? |
A. | Yes |
B. | No |
Answer» B. No | |
519. |
On executing the below program what will be the contents of 'target.txt' file if the source file contains a line "To err is human"?
|
A. | r n |
B. | Trh |
C. | err |
D. | None of above |
Answer» C. err | |
520. |
Bitwise | can be used to multiply a number by powers of 2. |
A. | Yes |
B. | No |
Answer» C. | |
521. |
How many bytes of memory will the following code reserve?
|
A. | 65536 |
B. | Allocation failed |
C. | Error |
D. | No output |
Answer» C. Error | |
522. |
Assume integer is 2 bytes wide. What will be the output of the following code?
|
A. | 2, 8 |
B. | 4, 16 |
C. | 8, 24 |
D. | 16, 32 |
Answer» B. 4, 16 | |
523. |
Preprocessor directive #undef can be used only on a macro that has been #define earlier |
A. | True |
B. | False |
Answer» B. False | |
524. |
What will be the output of the program ?
|
A. | Hello |
B. | World |
C. | Hello World |
D. | WorldHello |
Answer» D. WorldHello | |
525. |
Which statement will you add to the following program to ensure that the program outputs "IndiaBIX" on execution?
|
A. | *pt=''; |
B. | pt=' 0'; |
C. | pt=' n'; |
D. | *pt=' 0'; |
Answer» E. | |
526. |
What will be the output of the program ?
|
A. | A |
B. | a |
C. | c |
D. | 65 |
Answer» B. a | |
527. |
What will be the output of the program ?
|
A. | 10 |
B. | 20 |
C. | 30 |
D. | 0 |
Answer» C. 30 | |
528. |
Nested unions are allowed |
A. | True |
B. | False |
Answer» B. False | |
529. |
What will be the output of the program?
|
A. | 32 |
B. | 64 |
C. | 0 |
D. | 128 |
Answer» B. 64 | |
530. |
Can we have an array of bit fields? |
A. | Yes |
B. | No |
Answer» C. | |
531. |
To scan a and b given below, which of the following scanf() statement will you use?
|
A. | scanf("%f %f", &a, &b); |
B. | scanf("%Lf %Lf", &a, &b); |
C. | scanf("%f %Lf", &a, &b); |
D. | scanf("%f %lf", &a, &b); |
Answer» E. | |
532. |
What will be the output of the program?
|
A. | 1 |
B. | <span>0</span> |
C. | -1 |
D. | 2 |
Answer» C. -1 | |
533. |
What will be the output of the program?
|
A. | Garbage value |
B. | Error |
C. | 20 |
D. | 0 |
Answer» D. 0 | |
534. |
Will the program outputs "IndiaBIX.com"?
|
A. | Yes |
B. | No |
Answer» C. | |
535. |
Which of the following is the correct usage of conditional operators used in C? |
A. | a>b ? c=30 : c=40; |
B. | a>b ? c=30; |
C. | max = a>b ? a>c?a:c:b>c?b:c |
D. | return (a>b)?(a:b) |
Answer» D. return (a>b)?(a:b) | |
536. |
What will be the output of the program?
|
A. | 2.000000, 1.000000 |
B. | 1.500000, 1.500000 |
C. | 1.550000, 2.000000 |
D. | 1.000000, 2.000000 |
Answer» B. 1.500000, 1.500000 | |
537. |
What will be the output of the program?
|
A. | 2.2, 2.50, 2.50, 2.5 |
B. | 2.2e, 2.25f, 2.00, 2.25 |
C. | 2.250000e+000, 2.250000, 2.25, 2.250000 |
D. | Error |
Answer» D. Error | |
538. |
If a function contains two return statements successively, the compiler will generate warnings. Yes/No ? |
A. | Yes |
B. | No |
Answer» B. No | |
539. |
What will be the output of the program?
|
A. | 10 |
B. | Garbage value |
C. | 10.100000 |
D. | Error |
Answer» D. Error | |
540. |
Assume integer is 2 bytes wide. How many bytes will be allocated for the following code?
|
A. | 56 bytes |
B. | 128 bytes |
C. | 24 bytes |
D. | 12 bytes |
Answer» D. 12 bytes | |
541. |
We can allocate a 2-Dimensional array dynamically. |
A. | True |
B. | False |
Answer» B. False | |
542. |
Function can return a floating point number. |
A. | True |
B. | False |
Answer» B. False | |
543. |
malloc() returns a float pointer if memory is allocated for storing float's and a double pointer if memory is allocated for storing double's. |
A. | True |
B. | False |
Answer» C. | |
544. |
malloc() allocates memory from the heap and not from the stack. |
A. | True |
B. | False |
Answer» B. False | |
545. |
Point out the correct statement which correctly allocates memory dynamically for 2D array following program?
|
A. | p = (int*) malloc(3, 4); |
B. | p = (int*) malloc(3*sizeof(int)); |
C. | p = malloc(3*4*sizeof(int)); |
D. | p = (int*) malloc(3*4*sizeof(int)); |
Answer» E. | |
546. |
typedef's have the advantage that they obey scope rules, that is they can be declared local to a function or a block whereas #define's always have a global effect. |
A. | Yes |
B. | No |
Answer» B. No | |
547. |
Can I increase the size of dynamically allocated array? |
A. | Yes |
B. | No |
Answer» B. No | |
548. |
Is the following declaration acceptable?
|
A. | Yes |
B. | NO |
Answer» B. NO | |
549. |
malloc() returns a NULL if it fails to allocate the requested memory. |
A. | True |
B. | False |
Answer» B. False | |
550. |
If malloc() successfully allocates memory it returns the number of bytes it has allocated. |
A. | True |
B. | False |
Answer» C. | |