

MCQOPTIONS
Saved Bookmarks
This section includes 36 Mcqs, each offering curated multiple-choice questions to sharpen your Computer Science Engineering (CSE) knowledge and support exam preparation. Choose a topic below to get started.
1. |
What will be output if you will compile and execute the following c code? #include
|
A. | 12 |
B. | 8 |
C. | 4 |
D. | 1 |
Answer» B. 8 | |
2. |
What will be output if you will compile and execute the following c code? #include
|
A. | 2 |
B. | 4 |
C. | 8 |
D. | 10 |
Answer» D. 10 | |
3. |
Consider an implementation of unsorted singly linked list. Suppose it has its representation with a head pointer only. Given the representation, which of the following operation can be implemented in O(1) time?i) Insertion at the front of the linked listii) Insertion at the end of the linked listiii) Deletion of the front node of the linked listiv) Deletion of the last node of the linked list |
A. | i and ii |
B. | i and iii |
C. | i,ii and iii |
D. | i,ii and iv |
Answer» C. i,ii and iii | |
4. |
Consider an implementation of unsorted doubly linked list. Suppose it has its representation with a head pointer and tail pointer. Given the representation, which of the following operation can be implemented in O(1) time?i) Insertion at the front of the linked listii) Insertion at the end of the linked listiii) Deletion of the front node of the linked listiv) Deletion of the end node of the linked list |
A. | i and ii |
B. | i and iii |
C. | i,ii and iii |
D. | i,ii,iii and iv |
Answer» E. | |
5. |
What will be output if you will compile and execute the following c code? #include
|
A. | -60 |
B. | -30 |
C. | 60 |
D. | garbage value |
Answer» C. 60 | |
6. |
Consider the following definition in c programming languagestruct node{int data;struct node * next;}typedef struct node NODE;NODE *ptr;Which of the following c code is used to create new node? |
A. | ptr=(node*)malloc(sizeof(node)); |
B. | ptr=(node*)malloc(node); |
C. | ptr=(node*)malloc(sizeof(node*)); |
D. | ptr=(node)malloc(sizeof(node)); |
Answer» B. ptr=(node*)malloc(node); | |
7. |
The memory address of fifth element of an array can be calculated by the formula |
A. | LOC(Array[5])=Base(Array[5])+(5-lower boun(D), where w is the number of words per memory cell for the array |
B. | LOC(Array[5])=Base(Array[4])+(5-Upper boun(D), where w is the number of words per memory cell for the array |
C. | LOC(Array[5]=Base(Array)+w(5-lower bou |
D. | , where w is the number of words per memory cell for the array |
Answer» D. , where w is the number of words per memory cell for the array | |
8. |
Each data item in a record may be a group item composed of sub-items; those items which are indecomposable are called |
A. | Elementary items |
B. | Atoms |
C. | Scalars |
D. | All of above |
Answer» E. | |
9. |
consider the function f defined here:struct item{int data;struct item * next;};int f (struct item *p){return((p==NULL) ||((p->next==NULL)||(p->data<=p->next->data) && (p->next)));}For a given linked list p, the function f returns 1 if and only if |
A. | the list is empty or has exactly one element |
B. | the element in the list are sorted in non-decreasing order of data value |
C. | the element in the list are sorted in non-increasing order of data value |
D. | not all element in the list have the same data value |
Answer» C. the element in the list are sorted in non-increasing order of data value | |
10. |
Each array declaration need not give, implicitly or explicitly, the information about the |
A. | name of array |
B. | data type of array |
C. | first data from the set to be stored |
D. | index set of the array |
Answer» D. index set of the array | |
11. |
What is error in following declaration?struct outer{ int a;struct inner{char c;};}; |
A. | nesting of structure is not allowed in c |
B. | it is necessary to initialize the member variable |
C. | inner structure must have name |
D. | outer structure must have name |
Answer» D. outer structure must have name | |
12. |
What will be output if you will compile and execute the following c code? #include
|
A. | 320 |
B. | 1 |
C. | 64 |
D. | none of the above |
Answer» D. none of the above | |
13. |
When in order traversing a tree resulted E A C K F H D B G; the preorder traversal would return |
A. | FAEKCDBHG |
B. | FAEKCDHGB |
C. | EAFKHDCBG |
D. | FEAKDCHBG |
Answer» C. EAFKHDCBG | |
14. |
What will be output if you will compile and execute the following c code?#include
|
A. | cquestionbank |
B. | cquestionbank 0 |
C. | (null) |
D. | it will print nothing |
Answer» D. it will print nothing | |
15. |
In a binary tree, certain null entries are re- placed by special pointers which point to nodes higher in tree for efficiency. These special pointers are called |
A. | Leaf |
B. | Branch |
C. | Path |
D. | Thread |
Answer» E. | |
16. |
What will be output if you will compile and execute the following c code?#include
|
A. | 8 |
B. | 8 |
C. | 9 |
D. | compiler error |
Answer» E. | |
17. |
What will be output if you will compile and execute the following c code? #include
|
A. | 25 |
B. | 26 |
C. | any adress |
D. | garbage value |
Answer» E. | |
18. |
What will be output if you will compile and execute the following c code? #include
|
A. | 135 |
B. | +inf |
C. | -121 |
D. | -8 |
Answer» D. -8 | |
19. |
What will be output if you will compile and execute the following c code? #include
|
A. | 5 |
B. | 6 |
C. | 7 |
D. | 0 |
Answer» E. | |
20. |
#include
|
A. | 0 1 2 3 |
B. | 0 1 2 |
C. | 1 2 3 |
D. | compiler error |
Answer» D. compiler error | |
21. |
What will be output if you will compile and execute the following c code? #include
|
A. | equal |
B. | less than |
C. | greater than |
D. | compiler error |
Answer» C. greater than | |
22. |
What will be output if you will compile and execute the following c code? #include
|
A. | 4 |
B. | 5 |
C. | 6 |
D. | compiler error |
Answer» D. compiler error | |
23. |
What will be output if you will compile and execute the following c code? #include
|
A. | 12 11 11 |
B. | 12 10 10 |
C. | 11 11 12 |
D. | 10 10 12 |
Answer» B. 12 10 10 | |
24. |
What will be output if you will compile and execute the following c code? #include
|
A. | 10hello world |
B. | 11hello world |
C. | hello world12 |
D. | hello world13 |
Answer» E. | |
25. |
What will be output if you will compile and execute the following c code? #include
|
A. | it will print nothing |
B. | -3 |
C. | -2 |
D. | compiler error |
Answer» E. | |
26. |
What will be output if you will compile and execute the following c code? #include
|
A. | 343 |
B. | 27 |
C. | 133 |
D. | compiler error |
Answer» C. 133 | |
27. |
What will be output if you will compile and execute the following c code? #include
|
A. | 35 |
B. | 510 |
C. | 15 |
D. | 40 |
Answer» E. | |
28. |
What will be output if you will compile and execute the following c code? #include
|
A. | equal |
B. | less than |
C. | greater than |
D. | compiler error |
Answer» E. | |
29. |
What will be output if you will compile and execute the following c code? #include
|
A. | 21 |
B. | 18 |
C. | 12 |
D. | compiler error |
Answer» B. 18 | |
30. |
What will be the output of the program? #include
|
A. | 40 40 |
B. | 20 20 |
C. | 20 |
D. | error |
Answer» E. | |
31. |
The program fragmentint i = 263 ;putchar (i) ;prints |
A. | 263 |
B. | ascii equivalent of 263 |
C. | rings the bell |
D. | garbage |
Answer» D. garbage | |
32. |
What will be the output of the program? #include
|
A. | hello |
B. | hi hello |
C. | no output |
D. | infinite loop |
Answer» B. hi hello | |
33. |
How many times the program will print "Amrutvahini" ? #include
|
A. | infinite times |
B. | 32767 times |
C. | 65535 times |
D. | till stack overflows |
Answer» E. | |
34. |
Which of the following is not a limitation of binary search algorithm ? |
A. | binary search algorithm is not efficient when the data elements are more than 1000. |
B. | must use a sorted array |
C. | requirement of sorted array is expen- sive when a lot of insertion and dele- tions are needed |
D. | there must be a mechanism to access middle element directly |
Answer» B. must use a sorted array | |
35. |
The complexity of the average case of an algorithm is |
A. | Much more complicated to analyze than that of worst case |
B. | Much more simpler to analyze than that of worst case |
C. | Sometimes more complicated and some other times simpler than that of worst case |
D. | None of the above |
Answer» B. Much more simpler to analyze than that of worst case | |
36. |
Consider an implementation of unsorted singly linked list. Suppose it has its representation with a head and tail pointer. Given the representation, which of the following operation can be implemented in O(1) time?i) Insertion at the front of the linked listii) Insertion at the end of the linked listiii) Deletion of the front node of the linked listiv) Deletion of the last node of the linked lis |
A. | i and ii |
B. | i and iii |
C. | i,ii and iii |
D. | i,ii and iv |
Answer» D. i,ii and iv | |