Order PDF of any content from our website with a little minor Fee to donate for hard work. Online MCQs are fully free but PDF books are paid. For details: contact whatsapp +923028700085 Important notes based PDF Books are available in very little price, starting from 500/-PKR; Order Now: contact whatsapp +923028700085

Past Papers CS201-Midterm Important MCQs (1–118)

CS201 Midterm – Important Questions & Answers

  1. Application Software is used to: Solve end-user problems → 3
  2. A computer can do: Exactly what we tell it → 4
  3. Control a program while running using: Debugger → 1
  4. Part of system software: Linker and Loaders → 1
  5. Remainder (%) operator is: Arithmetic → 1
  6. int x = 2 * 3 + 4 * 5; x = 26 → 2
  7. Correct return value to OS on success: 0 → 3
  8. Only function all C++ programs must contain: main() → 3
  9. Punctuation for code blocks: { } → 1
  10. Line-ending punctuation: Semicolon (;) → 2
  11. Correct comment syntax: /* Comment */ → 3
  12. Incorrect variable type: real → 2
  13. Operator to compare two variables: == → 4
  14. Comments in C++: All lines starting with // → 2
  15. Function where programs start: Main() → 3
  16. Every statement ends with: Semicolon (;) → 3
  17. A variable is: Portion of memory to store a value → 2
  18. Value of 215/37+3*2 = 76 → 2
  19. Size of double variable: 8 bytes → 3
  20. Not a relational operator: == → 3
  21. Cannot be used as identifier: Spaces → 4
  22. number = number / 10; = number = number % 10; → FALSE → 2
  23. Value of uninitialized x: unknown → 3
  24. Flowchart process symbol: Rectangle → 1
  25. Boolean operator AND: && → 2
  26. !(1 && !(0 || 1)) evaluates to: TRUE → 1
  27. Unary operator: Logical NOT (!) → 4
  28. Correct if syntax: if(expression) → 3
  29. If statement executes when: Condition is true → 4
  30. Loader transfers code from memory to hard disk: FALSE → 2
  31. Final value of x in for(x=0; x<10; x++): 10 → 1
  32. While(x < 100) executes when: x < 100 → 1
  33. Not a loop: Repeat Until → 4
  34. for(int n=10; n>0; n++) → Infinite → 2
  35. Break in switch: Exits switch → 3
  36. For loop expressions: 3 → 3
  37. Do-while loop guaranteed iterations: 1 → 4
  38. x = x + 4; equivalent to: x += 4 → 1
  39. First expression in for loop: Counter initial value → 3
  40. Break statement usage: Quit current iteration → 2
  41. Continue statement usage: Stop current iteration and begin next → 2
  42. Output: for(int a=1;a<=1;a++) cout << a++; cout << a; → 12 → 2
  43. Every case statement followed by: : → 1
  44. Avoid fall-through in switch: break → 2
  45. Keyword for unhandled switch case: default → 3
  46. Output of switch example: ZeroHello World → 4
  47. Which is true? 1 → 1
  48. Every function is followed by: Parenthesis → 2
  49. Improper prototype: double funct(char x) → 2
  50. Return type of int func(char x, float v, double t): int → 2
  51. Valid function call: funct() → 3
  52. Complete function example: int funct(int x) { return x+1; } → 2
  53. Usefulness of function prototypes: All of the above → 4
  54. Function calling itself: Recursive → 3
  55. Preprocessor directive symbol: # → 1
  56. Control goes to function definition: TRUE → 1
  57. Preprocessor directives begin with: # → 3
  58. iostream includes: Standard input-output declarations → 1
  59. False statement: None → 4
  60. Preprocessor directive true: Ends with semicolon → 4
  61. *int j=123,k=234; int q,*r; r=&j; q=&k; cout<<q<<‘ ‘<<r; → 132,234 → 3
  62. If q uninitialized: Garbage → 4
  63. Correct array declaration: int anarray[10]; → 1
  64. Seventh element of foo: foo[6] → 1
  65. Address of first element: foo → 2
  66. Array length of int age[]={0..9}: 10 → 1
  67. c[3]=33; assigns to: 4th element → 2
  68. Copying arrays:3
  69. Loop executed for: 6 times → 1
  70. #define sum(a,b) a+b → sum(3+1,2); → 6 → 2
  71. int m=0,v=0; for(m=5;m<8;m++){ v=v+(m++)+(++m); } → 11 → 2
  72. Variable scope: Cannot use in another function → 1
  73. const variable must initialize: TRUE → 1
  74. void allocateme(int p)… cout<<i;* → 1 → 1
  75. numarray[0][3]: 4 → 4
  76. Pointers uninitialized: Garbage → 4
  77. Pointer to integer address 0x22ff74: int *x; *x=0x22ff74; → 1
  78. Array is: constant pointer → 4
  79. Proper pointer declaration: int *x; → 4
  80. Memory address of a: &a → 1
  81. Allocate memory operator: new → 1
  82. Deallocate memory keyword: delete → 2
  83. swap(&x,&y); call by: Reference → 1
  84. Pointer declaration symbol: * → 3
  85. Pointer reference symbol: & → 2
  86. x=y; x=pointer; gives: Address of first element → 3
  87. Adding to pointer: Points to next array element → 3
  88. Unary operator: ~ → 4
  89. i++; equivalent to: i=i+1 → 2
  90. Variable defined inside function: Functional variable → 3
  91. Two-dimensional array: int anarray[20][20]; → 2
  92. twoDArray[1][2]: 2 → 2
  93. Array of pointers: pointers to pointers → 1
  94. Pointers may be: stored in array → 2
  95. Array passed to function: Call by reference → 3
  96. isdigit(int c): Returns TRUE if digit → 3
  97. isupper(int c): Returns TRUE if uppercase → 1
  98. *atof(const char nPtr): Converts to double → 1
  99. File handling steps: Open, read/write, close → 1
  100. ofstream outFile → File opened for writing → 1
  101. Current position in reading file: tellg() → 1
  102. Current position in writing file: tellp() → 4
  103. Class handling file input: ifstream → 2
  104. aFile.seekg(10L, ios::beg): Move 10 bytes forward → 2
  105. seekg() function gives: Data length → 1
  106. tellg() returns: long → 3
  107. inputFile.getc() & outputFile.putc(): character, character → 1
  108. Bytes reserved operator: sizeof → 1
  109. Access structure members: . → 4
  110. Member of struct: Variable → 1
  111. Properly defined struct: struct a_struct { int a; }; → 4
  112. Declare struct Student variable: struct Student; → 2
  113. Using structures: Simple variables, pointers, arrays → 1
  114. Compiler processes first: Preprocessor directives → 4
  115. Class template first line: template<class T> → 3
  116. 5 | 6 in decimal: 7 → 1
  117. 5 & 6 in decimal: 4 → 1
  118. 5 ^ 6 in decimal: 3 → 3
Contents Copyrights Reserved By T4Tutorials