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
CS201 Midterm – Important Questions & Answers
- Application Software is used to: Solve end-user problems → 3
- A computer can do: Exactly what we tell it → 4
- Control a program while running using: Debugger → 1
- Part of system software: Linker and Loaders → 1
- Remainder (%) operator is: Arithmetic → 1
- int x = 2 * 3 + 4 * 5; x = 26 → 2
- Correct return value to OS on success: 0 → 3
- Only function all C++ programs must contain: main() → 3
- Punctuation for code blocks: { } → 1
- Line-ending punctuation: Semicolon (;) → 2
- Correct comment syntax: /* Comment */ → 3
- Incorrect variable type: real → 2
- Operator to compare two variables: == → 4
- Comments in C++: All lines starting with // → 2
- Function where programs start: Main() → 3
- Every statement ends with: Semicolon (;) → 3
- A variable is: Portion of memory to store a value → 2
- Value of 215/37+3*2 = 76 → 2
- Size of double variable: 8 bytes → 3
- Not a relational operator: == → 3
- Cannot be used as identifier: Spaces → 4
- number = number / 10; = number = number % 10; → FALSE → 2
- Value of uninitialized x: unknown → 3
- Flowchart process symbol: Rectangle → 1
- Boolean operator AND: && → 2
- !(1 && !(0 || 1)) evaluates to: TRUE → 1
- Unary operator: Logical NOT (!) → 4
- Correct if syntax: if(expression) → 3
- If statement executes when: Condition is true → 4
- Loader transfers code from memory to hard disk: FALSE → 2
- Final value of x in for(x=0; x<10; x++): 10 → 1
- While(x < 100) executes when: x < 100 → 1
- Not a loop: Repeat Until → 4
- for(int n=10; n>0; n++) → Infinite → 2
- Break in switch: Exits switch → 3
- For loop expressions: 3 → 3
- Do-while loop guaranteed iterations: 1 → 4
- x = x + 4; equivalent to: x += 4 → 1
- First expression in for loop: Counter initial value → 3
- Break statement usage: Quit current iteration → 2
- Continue statement usage: Stop current iteration and begin next → 2
- Output: for(int a=1;a<=1;a++) cout << a++; cout << a; → 12 → 2
- Every case statement followed by: : → 1
- Avoid fall-through in switch: break → 2
- Keyword for unhandled switch case: default → 3
- Output of switch example: ZeroHello World → 4
- Which is true? 1 → 1
- Every function is followed by: Parenthesis → 2
- Improper prototype: double funct(char x) → 2
- Return type of int func(char x, float v, double t): int → 2
- Valid function call: funct() → 3
- Complete function example: int funct(int x) { return x+1; } → 2
- Usefulness of function prototypes: All of the above → 4
- Function calling itself: Recursive → 3
- Preprocessor directive symbol: # → 1
- Control goes to function definition: TRUE → 1
- Preprocessor directives begin with: # → 3
- iostream includes: Standard input-output declarations → 1
- False statement: None → 4
- Preprocessor directive true: Ends with semicolon → 4
- *int j=123,k=234; int q,*r; r=&j; q=&k; cout<<q<<‘ ‘<<r; → 132,234 → 3
- If q uninitialized: Garbage → 4
- Correct array declaration: int anarray[10]; → 1
- Seventh element of foo: foo[6] → 1
- Address of first element: foo → 2
- Array length of int age[]={0..9}: 10 → 1
- c[3]=33; assigns to: 4th element → 2
- Copying arrays: → 3
- Loop executed for: 6 times → 1
- #define sum(a,b) a+b → sum(3+1,2); → 6 → 2
- int m=0,v=0; for(m=5;m<8;m++){ v=v+(m++)+(++m); } → 11 → 2
- Variable scope: Cannot use in another function → 1
- const variable must initialize: TRUE → 1
- void allocateme(int p)… cout<<i;* → 1 → 1
- numarray[0][3]: 4 → 4
- Pointers uninitialized: Garbage → 4
- Pointer to integer address 0x22ff74: int *x; *x=0x22ff74; → 1
- Array is: constant pointer → 4
- Proper pointer declaration: int *x; → 4
- Memory address of a: &a → 1
- Allocate memory operator: new → 1
- Deallocate memory keyword: delete → 2
- swap(&x,&y); call by: Reference → 1
- Pointer declaration symbol: * → 3
- Pointer reference symbol: & → 2
- x=y; x=pointer; gives: Address of first element → 3
- Adding to pointer: Points to next array element → 3
- Unary operator: ~ → 4
- i++; equivalent to: i=i+1 → 2
- Variable defined inside function: Functional variable → 3
- Two-dimensional array: int anarray[20][20]; → 2
- twoDArray[1][2]: 2 → 2
- Array of pointers: pointers to pointers → 1
- Pointers may be: stored in array → 2
- Array passed to function: Call by reference → 3
- isdigit(int c): Returns TRUE if digit → 3
- isupper(int c): Returns TRUE if uppercase → 1
- *atof(const char nPtr): Converts to double → 1
- File handling steps: Open, read/write, close → 1
- ofstream outFile → File opened for writing → 1
- Current position in reading file: tellg() → 1
- Current position in writing file: tellp() → 4
- Class handling file input: ifstream → 2
- aFile.seekg(10L, ios::beg): Move 10 bytes forward → 2
- seekg() function gives: Data length → 1
- tellg() returns: long → 3
- inputFile.getc() & outputFile.putc(): character, character → 1
- Bytes reserved operator: sizeof → 1
- Access structure members: . → 4
- Member of struct: Variable → 1
- Properly defined struct: struct a_struct { int a; }; → 4
- Declare struct Student variable: struct Student; → 2
- Using structures: Simple variables, pointers, arrays → 1
- Compiler processes first: Preprocessor directives → 4
- Class template first line: template<class T> → 3
- 5 | 6 in decimal: 7 → 1
- 5 & 6 in decimal: 4 → 1
- 5 ^ 6 in decimal: 3 → 3