MCQOPTIONS
Saved Bookmarks
This section includes 33 Mcqs, each offering curated multiple-choice questions to sharpen your Aspire knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
The maximum combined length of the command-line arguments including the spaces between adjacent arguments is |
| A. | 128 characters |
| B. | 256 characters |
| C. | 67 characters |
| D. | It may vary from one operating system to another |
| Answer» E. | |
| 2. |
Choose the correct answer Afzal writes a piece of code, where a set of three lines occur around 10 times in different parts of the program. What programming concept can he use to shorten his program code length? |
| A. | Use for loops |
| B. | Use functions |
| C. | Use arrays |
| D. | Use classes |
| Answer» C. Use arrays | |
| 3. |
Consider the following function function calculate( n ) { if(n equals 5) return 5 else return (n + calculate(n-5)) end } Shishir calls the function by the statement, calculate(20). What value will the function return? |
| A. | 50 |
| B. | 200 |
| C. | 35 |
| D. | 20 |
| Answer» B. 200 | |
| 4. |
Which of the following is true? |
| A. | realloc() can change the memory size of arrays |
| B. | Unary operator works on only one operand |
| C. | Struct and Union works in same way. |
| D. | None of the above |
| Answer» C. Struct and Union works in same way. | |
| 5. |
Comment on the below while statement while (0 == 0) { } |
| A. | It has syntax error as there are no statements within braces {} |
| B. | It will run forever |
| C. | It compares 0 with 0 and since they are equal it will exit the loop immediately |
| D. | It has syntax error as the same number is being compared with itself |
| Answer» C. It compares 0 with 0 and since they are equal it will exit the loop immediately | |
| 6. |
Which one is used during memory deallocation in C? |
| A. | remove(p); |
| B. | delete(p); |
| C. | free(p); |
| D. | terminate(p); |
| Answer» D. terminate(p); | |
| 7. |
What type of value does sizeof return? |
| A. | char |
| B. | short |
| C. | unsigned int |
| D. | long |
| Answer» D. long | |
| 8. |
What is the sizeof(char) in a 32-bit C compiler? |
| A. | 1 bit |
| B. | 2 bits |
| C. | 1 Byte |
| D. | 2 Bytes |
| Answer» D. 2 Bytes | |
| 9. |
Memory allocation using malloc() is done in? |
| A. | Static area |
| B. | Stack area |
| C. | Heap area |
| D. | Both Stack & Heap area |
| Answer» D. Both Stack & Heap area | |
| 10. |
What is the default return-type of getchar()? |
| A. | char |
| B. | int |
| C. | char * |
| D. | reading character doesn’t require a return-type |
| Answer» C. char * | |
| 11. |
For a typical program, the input is taken using |
| A. | scanf |
| B. | Files |
| C. | Command-line |
| D. | All of the mentioned |
| Answer» E. | |
| 12. |
The function ____ obtains block of memory dynamically. |
| A. | calloc |
| B. | malloc |
| C. | Both calloc & malloc |
| D. | free |
| Answer» D. free | |
| 13. |
In the standard library of C programming language, which of the following header file is designed for basic mathematical operations? |
| A. | conio.h |
| B. | stdio.h |
| C. | math.h |
| D. | dos.h |
| Answer» D. dos.h | |
| 14. |
Strings are character arrays. The last index of it contains the null-terminated character |
| A. | |
| B. | 1 |
| C. | 0 |
| D. | |
| Answer» D. | |
| 15. |
. A memory leak happens when |
| A. | a program allocates memory in heap but forgets to be allocate it |
| B. | when an un-assigned pointer is used is freed using free function |
| C. | when realloc() is called on a pointer that is not allocated |
| D. | A program allocates memory in stack |
| Answer» B. when an un-assigned pointer is used is freed using free function | |
| 16. |
while declaring parameters for main, the second parameter argv should be declared as |
| A. | char argv[] |
| B. | char argv |
| C. | char ** argv[] |
| D. | char * argv[] |
| Answer» E. | |
| 17. |
Where are the local variable stored ? |
| A. | In a Queue |
| B. | In stack Memory |
| C. | In hard Disk |
| D. | In heap Memory |
| Answer» B. In stack Memory | |
| 18. |
which of the below function is NOT declared in math.h ? |
| A. | and() |
| B. | pow() |
| C. | exp() |
| D. | acos() |
| Answer» B. pow() | |
| 19. |
Which of the following is NOT declared in string.h ? |
| A. | strlen() |
| B. | strcpy() |
| C. | strptr() |
| D. | strupr() |
| Answer» D. strupr() | |
| 20. |
atoi() function is used for: |
| A. | convert ASCII character to integer value |
| B. | convert a character string to its equivalent integer value |
| C. | gets index value of character in an array |
| D. | converts an array of characters to array of equivalent integers |
| Answer» C. gets index value of character in an array | |
| 21. |
What is the similarity between enum and struct ? |
| A. | can assign new values |
| B. | can create new data types |
| C. | nothing in common |
| D. | they are same |
| Answer» C. nothing in common | |
| 22. |
What is recursion ? |
| A. | looping |
| B. | a function calls another function repeatedly |
| C. | a fnction calls repeatedly |
| D. | function calls itself repeatedly |
| Answer» E. | |
| 23. |
what is the purpose of ftell ? |
| A. | to get the current file position |
| B. | to get the current file attribute |
| C. | to get the current file status |
| D. | to get the current file name |
| Answer» B. to get the current file attribute | |
| 24. |
What is dangling pointer? |
| A. | points to garbage value |
| B. | points to function |
| C. | Both A and B |
| D. | None of these |
| Answer» B. points to function | |
| 25. |
Where the local variable is stored ? |
| A. | Disk |
| B. | Stack |
| C. | Heap |
| D. | Register |
| Answer» C. Heap | |
| 26. |
Which of the following indicate the end of file ? |
| A. | feof() |
| B. | EOF |
| C. | Both feof() and EOF |
| D. | None of the mentioned |
| Answer» D. None of the mentioned | |
| 27. |
Choose the correct statement while (0 == 0) { } |
| A. | It has syntax error as there are no statements within braces {} |
| B. | It will run forever |
| C. | It compares 0 with 0 and since they are equal it will exit the loop immediately |
| D. | It has syntax error as the same number is being compared with itself |
| Answer» C. It compares 0 with 0 and since they are equal it will exit the loop immediately | |
| 28. |
Which of the following network topology allows bi-directional links between each possible node? |
| A. | Star |
| B. | Ring |
| C. | Tree |
| D. | Mesh |
| Answer» E. | |
| 29. |
The prefix of (X+Y)*(C-D) is |
| A. | +- XY*CD |
| B. | *+-XYCD |
| C. | * +XY-CD |
| D. | *XY+CD |
| Answer» D. *XY+CD | |
| 30. |
What is the full form of ISDN? |
| A. | Integrated Services Digital Network |
| B. | Integrated Services Data Network |
| C. | Integrated Standard Digital Network |
| D. | Integrated Standard Data Network |
| Answer» B. Integrated Services Data Network | |
| 31. |
How do you eliminate the path? |
| A. | [C:] path ; |
| B. | [C:] path = null |
| C. | [C:] path = 0 |
| D. | [C:] setpath = 0; |
| Answer» B. [C:] path = null | |
| 32. |
Which of the following binary tree has the characteristics that the value at each node is at least as large as the values at its children? |
| A. | AVL tree |
| B. | heap |
| C. | binary search tree |
| D. | completely balanced tree |
| Answer» C. binary search tree | |
| 33. |
Which of the following is correct about root directory? |
| A. | It is the path where the system files are manipulated |
| B. | It is the path where the data files are stored |
| C. | The first level of directories on a disk |
| D. | All of These |
| Answer» D. All of These | |