CS201 – Introduction to Programming: Midterm Important MCQs (436 Solved Questions)

Computer Science • Read every solved MCQ with its verified answer key directly on this page. Free, no login required.

All 664 Midterm Packs · CS201 Course Page · CS201 Subjective Pack (36 Q&As)

  1. There are mainly ________ types of software.
    Topic: Programming Basics & Program Design (29 MCQs)
    1. Two ✓ Correct answer
    2. Three
    3. Four
    4. Five
  2. In C/C++, the #include is called:
    Topic: Programming Basics & Program Design (29 MCQs)
    1. Header file
    2. Preprocessor directive ✓ Correct answer
    3. Statement
    4. Function
  3. A precise sequence of steps to solve a problem is called:
    Topic: Programming Basics & Program Design (29 MCQs)
    1. Statement
    2. Program ✓ Correct answer
    3. Utility
    4. Routine
  4. Analysis is the ________ step in designing a program.
    Topic: Programming Basics & Program Design (29 MCQs)
    1. Last
    2. Middle
    3. Post Design
    4. First ✓ Correct answer
  5. In ________, we try to have a precise problem statement.
    Topic: Programming Basics & Program Design (29 MCQs)
    1. Design
    2. Analysis ✓ Correct answer
    3. Coding
    4. Testing
  6. At the design phase, we try to break up the problem into ________.
    Topic: Programming Basics & Program Design (29 MCQs)
    1. Functional units ✓ Correct answer
    2. Variables
    3. Loops
    4. Files
  7. For breaking a complex problem into smaller pieces, we use ________.
    Topic: Programming Basics & Program Design (29 MCQs)
    1. Loops
    2. Functions ✓ Correct answer
    3. Arrays
    4. Pointers
  8. In a flow chart, the symbol used for decision making is:
    Topic: Programming Basics & Program Design (29 MCQs)
    1. Rectangle
    2. Circle
    3. Arrow
    4. Diamond ✓ Correct answer
  9. In a flow chart, a process is represented by:
    Topic: Programming Basics & Program Design (29 MCQs)
    1. Rectangle ✓ Correct answer
    2. Arrow symbol
    3. Oval
    4. Circle
  10. Paying attention to detail in designing a program is ________.
    Topic: Programming Basics & Program Design (29 MCQs)
    1. Time consuming
    2. Redundant
    3. Necessary ✓ Correct answer
    4. Somewhat good
  11. While programming, it is good to provide an easy to understand and easy to use interface; this programming skill is called ________.
    Topic: Programming Basics & Program Design (29 MCQs)
    1. Scalability
    2. Usability ✓ Correct answer
    3. Reliability
    4. Sustainability
  12. Commenting the code ________.
    Topic: Programming Basics & Program Design (29 MCQs)
    1. Makes a program easy to understand for others ✓ Correct answer
    2. Makes programs heavy, i.e. more space is needed for executable
    3. Makes it difficult to compile
    4. All of the given options
  13. Word processor is a type of:
    Topic: Programming Basics & Program Design (29 MCQs)
    1. Operating system
    2. Application software ✓ Correct answer
    3. Device driver
    4. Utility software
  14. C is widely known as the development language of the ________ operating system.
    Topic: Programming Basics & Program Design (29 MCQs)
    1. Windows
    2. Unix ✓ Correct answer
    3. Mac OS
    4. Linux
  15. The compiler of the C language is written in:
    Topic: Programming Basics & Program Design (29 MCQs)
    1. Java language
    2. UNIX
    3. FORTRAN language
    4. C language ✓ Correct answer
  16. C is a/an ________ language.
    Topic: Programming Basics & Program Design (29 MCQs)
    1. Low level
    2. Object based
    3. Object oriented
    4. Function oriented ✓ Correct answer
  17. C++ is a ________ language.
    Topic: Programming Basics & Program Design (29 MCQs)
    1. High level ✓ Correct answer
    2. Low level
    3. Assembly
    4. Machine
  18. A compiler translates a high level language program into ________ language code.
    Topic: Programming Basics & Program Design (29 MCQs)
    1. Assembly
    2. Machine ✓ Correct answer
    3. Source
    4. Object-oriented
  19. Which of the following is an extension of a header file?
    Topic: Programming Basics & Program Design (29 MCQs)
    1. .exe
    2. .txt
    3. .h ✓ Correct answer
    4. .c
  20. If you create a header file of your own and save it in the current working directory, then you must enclose your header file within ________.
    Topic: Programming Basics & Program Design (29 MCQs)
    1. Angle brackets < >
    2. Quotation marks ✓ Correct answer
    3. Square brackets [ ]
    4. Parentheses ( )
  21. For console input and output we use the ________ header file.
    Topic: Programming Basics & Program Design (29 MCQs)
    1. conio.h ✓ Correct answer
    2. iostream.h
    3. fstream.h
    4. stdlib.h
  22. We should not use variable names that are starting with ________, because in C++ there are lots of internal constants and symbolic names that start with it.
    Topic: Programming Basics & Program Design (29 MCQs)
    1. A capital letter
    2. Double underscore ✓ Correct answer
    3. A digit
    4. The dollar sign
  23. Which of the following cannot be a variable name?
    Topic: Programming Basics & Program Design (29 MCQs)
    1. area
    2. _area
    3. 10area ✓ Correct answer
    4. area2
  24. What is the other name of a variable?
    Topic: Programming Basics & Program Design (29 MCQs)
    1. Constant
    2. Identifier ✓ Correct answer
    3. Operator
    4. Keyword
  25. Which of the following is NOT a reserved word in C/C++?
    Topic: Programming Basics & Program Design (29 MCQs)
    1. int
    2. float
    3. double
    4. sum ✓ Correct answer
  26. The variables having a name, type and size are just like empty boxes.
    Topic: Programming Basics & Program Design (29 MCQs)
    1. True ✓ Correct answer
    2. False
  27. Initialization of a variable at the time of definition is:
    Topic: Programming Basics & Program Design (29 MCQs)
    1. Must
    2. Necessary
    3. Good programming ✓ Correct answer
    4. None of the given options
  28. When we are using the const keyword with a variable x, then initializing it at the time of declaration is:
    Topic: Programming Basics & Program Design (29 MCQs)
    1. Must ✓ Correct answer
    2. Optional
    3. Not necessary
    4. A syntax error
  29. If a function has not been declared before it is used, it is a ________.
    Topic: Programming Basics & Program Design (29 MCQs)
    1. Logical error
    2. Syntax error ✓ Correct answer
    3. Run-time error
    4. Linker warning only
  30. The size of the int data type is:
    Topic: Data Types, Variables & Operators (21 MCQs)
    1. 1 byte
    2. 2 bytes
    3. 3 bytes
    4. 4 bytes ✓ Correct answer
  31. && is a ________ operator.
    Topic: Data Types, Variables & Operators (21 MCQs)
    1. Arithmetic
    2. Logical ✓ Correct answer
    3. Relational
    4. Unary
  32. <, <=, >, >= are called ________ operators.
    Topic: Data Types, Variables & Operators (21 MCQs)
    1. Arithmetic
    2. Logical
    3. Relational ✓ Correct answer
    4. Assignment
  33. Which one of the following is used to perform the bit-wise OR operation?
    Topic: Data Types, Variables & Operators (21 MCQs)
    1. ||
    2. | ✓ Correct answer
    3. &
    4. &&
  34. When the logical operator AND (&&) combines two expressions exp1 and exp2, then the result will be true only ________.
    Topic: Data Types, Variables & Operators (21 MCQs)
    1. When both exp1 and exp2 are true ✓ Correct answer
    2. When both exp1 and exp2 are false
    3. When exp1 is true and exp2 is false
    4. When exp1 is false and exp2 is true
  35. The expression ((a + b) == 10) && ((x + y) == 20) is true only if ________.
    Topic: Data Types, Variables & Operators (21 MCQs)
    1. Only (a + b) == 10 is true
    2. Only (x + y) == 20 is true
    3. Both ((a + b) == 10) and ((x + y) == 20) are true ✓ Correct answer
    4. Either of them is true
  36. a = a + 1; can also be written as ________.
    Topic: Data Types, Variables & Operators (21 MCQs)
    1. a += 1; ✓ Correct answer
    2. a =+ 1;
    3. a ++ 1;
    4. a = 1 +;
  37. Which of the following is the correct way to write a compound assignment operator?
    Topic: Data Types, Variables & Operators (21 MCQs)
    1. x =+ 4
    2. x += 4 ✓ Correct answer
    3. x + = 4
    4. x = +4
  38. If y = 20 and z = y++, then the value of z will be ________.
    Topic: Data Types, Variables & Operators (21 MCQs)
    1. 21
    2. 20 ✓ Correct answer
    3. 19
    4. 0
  39. ________ will return the number of bytes reserved for a variable or data type.
    Topic: Data Types, Variables & Operators (21 MCQs)
    1. sizeof operator ✓ Correct answer
    2. malloc function
    3. typedef operator
    4. strlen function
  40. Shifting the binary number is similar to shifting the ________ number.
    Topic: Data Types, Variables & Operators (21 MCQs)
    1. Octal
    2. Decimal ✓ Correct answer
    3. Hexadecimal
    4. Roman
  41. The address operator (&) can be used with a:
    Topic: Data Types, Variables & Operators (21 MCQs)
    1. Statement
    2. Expression
    3. Variable ✓ Correct answer
    4. Constant
  42. The ________ operator is used to pass the address of a variable in the call by reference method.
    Topic: Data Types, Variables & Operators (21 MCQs)
    1. *
    2. & ✓ Correct answer
    3. &&
    4. ->
  43. A reference to a variable can be obtained by preceding the identifier of the variable with the ________.
    Topic: Data Types, Variables & Operators (21 MCQs)
    1. Asterisk sign *
    2. Ampersand sign & ✓ Correct answer
    3. Percent sign %
    4. Dollar sign $
  44. In C/C++, the header file which is used to perform useful tasks and manipulation of character data is:
    Topic: Data Types, Variables & Operators (21 MCQs)
    1. cplext.h
    2. ctype.h ✓ Correct answer
    3. stdio.h
    4. delay.h
  45. Which of the following function(s) is/are included in the stdlib.h header file? 1. double atof(const char *nptr) 2. int atoi(const char *nptr) 3. char *strcpy(char *s1, const char *s2)
    Topic: Data Types, Variables & Operators
    1. double atof(const char *nptr)
    2. int atoi(const char *nptr)
    3. char *strcpy(char *s1, const char *s2)
    4. 1 and 2 only ✓ Correct answer
  46. Which of the following header files defines the rand() function?
    Topic: Data Types, Variables & Operators (21 MCQs)
    1. iostream.h
    2. conio.h
    3. stdlib.h ✓ Correct answer
    4. stdio.h
  47. To convert the value of one type into another type using built-in functions, we include the ________ header file.
    Topic: Data Types, Variables & Operators (21 MCQs)
    1. conio.h
    2. stdlib.h ✓ Correct answer
    3. iostream.h
    4. string.h
  48. ________ returns true if c is a letter and false otherwise.
    Topic: Data Types, Variables & Operators (21 MCQs)
    1. int isalpha(int c) ✓ Correct answer
    2. int isdigit(int c)
    3. int isalnum(int c)
    4. int isspace(int c)
  49. ________ returns true if c is a digit and false otherwise.
    Topic: Data Types, Variables & Operators (21 MCQs)
    1. int isalpha(int c)
    2. int isdigit(int c) ✓ Correct answer
    3. int islower(int c)
    4. int isupper(int c)
  50. The parameter passed to the isdigit() function is a/an ________ variable.
    Topic: Data Types, Variables & Operators (21 MCQs)
    1. Integer ✓ Correct answer
    2. Character array
    3. Float
    4. String
  51. In the if structure, the block of statements is executed only:
    Topic: Decision Structures (if & switch) (5 MCQs)
    1. When the condition is false
    2. When it contains arithmetic operators
    3. When it contains logical operators
    4. When the condition is true ✓ Correct answer
  52. The ________ structure is a multiple-selection construct which makes the code more efficient and easy to read and understand.
    Topic: Decision Structures (if & switch) (5 MCQs)
    1. multiple-if
    2. switch ✓ Correct answer
    3. if-else
    4. else-if
  53. The ________ statement allows us to select from multiple choices based on a set of fixed values for a given expression.
    Topic: Decision Structures (if & switch) (5 MCQs)
    1. switch ✓ Correct answer
    2. break
    3. continue
    4. goto
  54. The ________ statement is used to terminate the processing of a particular case and exit from the switch structure.
    Topic: Decision Structures (if & switch) (5 MCQs)
    1. continue
    2. goto
    3. break ✓ Correct answer
    4. return
  55. If the break statement is missed in a switch statement, then:
    Topic: Decision Structures (if & switch) (5 MCQs)
    1. The compiler will give an error
    2. This may cause a logical error ✓ Correct answer
    3. There is no effect on the program
    4. The program stops its execution
  56. The correct syntax of the do-while loop is:
    Topic: Loops (11 MCQs)
    1. (condition) while; do { statements; };
    2. { statements; } do-while ();
    3. while (condition); do { statements; };
    4. do { statements; } while (condition); ✓ Correct answer
  57. In a do-while loop, the condition is checked ________ one execution of the loop.
    Topic: Loops (11 MCQs)
    1. Before
    2. After ✓ Correct answer
    3. During
    4. Never
  58. Each pass through a loop is called a/an:
    Topic: Loops (11 MCQs)
    1. Enumeration
    2. Iteration ✓ Correct answer
    3. Culmination
    4. Pass through
  59. A continue statement causes execution to skip to:
    Topic: Loops (11 MCQs)
    1. The return 0; statement
    2. The first statement after the loop
    3. The statements following the continue statement
    4. The next iteration of the loop ✓ Correct answer
  60. The continue statement usually forces the immediate ________ iteration of the loop.
    Topic: Loops (11 MCQs)
    1. Previous
    2. Next ✓ Correct answer
    3. Last
    4. First
  61. Which looping process is best when the number of iterations is known?
    Topic: Loops (11 MCQs)
    1. for ✓ Correct answer
    2. while
    3. do-while
    4. All looping processes require that the iterations be known
  62. What's wrong with this for loop? for (int k = 2, k <= 12, k++)
    Topic: Loops (11 MCQs)
    1. The increment should always be ++k
    2. The variable must always be the letter i when using a for loop
    3. There should be a semicolon at the end of the statement
    4. The commas should be semicolons ✓ Correct answer
  63. The 'while' loop may execute ________ or more times.
    Topic: Loops (11 MCQs)
    1. Three
    2. Zero ✓ Correct answer
    3. Two
    4. One
  64. In the following nested for loop, which loop will run the most number of times? for (int i = 0; i < 5; i++) { for (int k = 0; k < 5; k++) { ............ } }
    Topic: Loops (11 MCQs)
    1. Outer loop
    2. Inner loop ✓ Correct answer
    3. Both run an equal number of times
    4. None of the given options
  65. What will be the output of the following code segment? for (int i = 2; i < 10; i++) { if (i == 5) continue; cout << i << ","; }
    Topic: Loops (11 MCQs)
    1. 2,3,4,5,6,7,8,9
    2. 2,3,4,6,7,8,9 ✓ Correct answer
    3. 2,3,4,5,6,7,8
    4. 3,4,6,7,8,9
  66. For which values of integer_value will the following code become an infinite loop? int number = 1; while (true) { cout << number; if (number == 3) break; number += integer_value; }
    Topic: Loops (11 MCQs)
    1. Any number other than 1 or 2 ✓ Correct answer
    2. Only 0
    3. Only 1
    4. Only 2
  67. The return type of a function that does not return any value must be ________.
    Topic: Functions & References (10 MCQs)
    1. int
    2. void ✓ Correct answer
    3. double
    4. float
  68. The call by reference mechanism should be used in a program when there is: (i) a large amount of data to be passed (ii) a small amount of data to be passed (iii) a need to change the passed data (iv) no need to change the passed data
    Topic: Functions & References (10 MCQs)
    1. (i) and (ii) only
    2. (i) and (iii) only ✓ Correct answer
    3. (ii) and (iii) only
    4. (ii) and (iv) only
  69. The keyword ________ is used to get some value back from a function.
    Topic: Functions & References (10 MCQs)
    1. return ✓ Correct answer
    2. break
    3. continue
    4. goto
  70. Identify the correct option which is used for calling the function: float area(int)
    Topic: Functions & References (10 MCQs)
    1. area(&num);
    2. area(num); ✓ Correct answer
    3. area(int num);
    4. area(*num);
  71. The function will return a reference to the global variable that exists throughout the program, and thus there will be no danger of ________.
    Topic: Functions & References (10 MCQs)
    1. Memory leak
    2. Dangling reference ✓ Correct answer
    3. Infinite loop
    4. Stack overflow
  72. To prevent a dangling reference, the function returning a reference should be used with ________.
    Topic: Functions & References (10 MCQs)
    1. Local variables
    2. Static and global variables ✓ Correct answer
    3. Temporary variables
    4. Register variables
  73. Reference variables must ________.
    Topic: Functions & References (10 MCQs)
    1. Be initialized at the time of declaration ✓ Correct answer
    2. Be initialized after they are declared
    3. Never be initialized
    4. Be initialized at the end of the program
  74. The difference between a pointer and a reference is that ________.
    Topic: Functions & References (10 MCQs)
    1. We can do arithmetic with pointers ✓ Correct answer
    2. We can do arithmetic with references
    3. Both support arithmetic
    4. Neither supports arithmetic
  75. How many parameter(s) does the function getline() take?
    Topic: Functions & References (10 MCQs)
    1. 0
    2. 1
    3. 2 ✓ Correct answer
    4. 3
  76. The function of cin is:
    Topic: Functions & References (10 MCQs)
    1. To display a message
    2. To read data from the keyboard ✓ Correct answer
    3. To display output on the screen
    4. To send data to the printer
  77. If the elements of an array are already sorted, then the useful search algorithm is:
    Topic: Arrays & Strings (40 MCQs)
    1. Linear search
    2. Binary search ✓ Correct answer
    3. Quick search
    4. Random search
  78. If there are 2^(n+1) elements in an array, then what would be the number of iterations required to search a number using the binary search algorithm?
    Topic: Arrays & Strings (40 MCQs)
    1. n elements
    2. (n+1) elements ✓ Correct answer
    3. 2(n+1) elements
    4. (n-1) elements
  79. Which of the following is the starting index of an array in C++?
    Topic: Arrays & Strings (40 MCQs)
    1. 0 ✓ Correct answer
    2. 1
    3. -1
    4. Any number
  80. If an array has 50 elements, what is the allowable range of subscripts?
    Topic: Arrays & Strings (40 MCQs)
    1. 1-50
    2. 0-49 ✓ Correct answer
    3. 0-50
    4. 1-49
  81. What is the highest legal index for the following array? int arr[4];
    Topic: Arrays & Strings (40 MCQs)
    1. 4
    2. 3 ✓ Correct answer
    3. 2
    4. 1
  82. In C++, what will be the highest index of the following array? int array[15];
    Topic: Arrays & Strings (40 MCQs)
    1. 15
    2. 16
    3. 14 ✓ Correct answer
    4. 13
  83. All elements of an array must be of ________ data type(s).
    Topic: Arrays & Strings (40 MCQs)
    1. Different
    2. Same ✓ Correct answer
    3. Mixed
    4. Any
  84. How do we declare an array of integer type whose size is 20 with the array name "count"?
    Topic: Arrays & Strings (40 MCQs)
    1. int count[20]; ✓ Correct answer
    2. count int[20];
    3. int [20]count;
    4. array count[20];
  85. What is the correct syntax to declare an array of size 10 of int data type?
    Topic: Arrays & Strings (40 MCQs)
    1. int [10] name;
    2. name[10] int;
    3. int name[10]; ✓ Correct answer
    4. int name[];
  86. Which one of the following is the correct syntax of an array declaration, where the array size is 5 and it is of float data type?
    Topic: Arrays & Strings (40 MCQs)
    1. float name[5]; ✓ Correct answer
    2. int name[5];
    3. float [5]name;
    4. float name(5);
  87. Following is the declaration of a ________ array. int arr[2][2][2];
    Topic: Arrays & Strings (40 MCQs)
    1. 1-Dimensional
    2. 2-Dimensional
    3. 3-Dimensional ✓ Correct answer
    4. Multi-dimensional pointer
  88. In a three-dimensional array, we use ________ for loop(s) to populate the array.
    Topic: Arrays & Strings (40 MCQs)
    1. 1
    2. 2
    3. 3 ✓ Correct answer
    4. 4
  89. To manipulate an n-dimensional array, ________ nested loops are required.
    Topic: Arrays & Strings (40 MCQs)
    1. 2
    2. n ✓ Correct answer
    3. n+1
    4. n-1
  90. When we declare a multidimensional array, the compiler stores the elements of the multidimensional array in the form of:
    Topic: Arrays & Strings (40 MCQs)
    1. Columns
    2. Rows
    3. Contiguous memory locations ✓ Correct answer
    4. Matrix
  91. We can define a matrix as a ________ array.
    Topic: Arrays & Strings (40 MCQs)
    1. Single dimensional
    2. Two-dimensional ✓ Correct answer
    3. Three-dimensional
    4. Zero-dimensional
  92. Transpose of a matrix means that when we interchange rows and columns, ________.
    Topic: Arrays & Strings (40 MCQs)
    1. The first row becomes the first column ✓ Correct answer
    2. The first column becomes the last row
    3. The matrix is reversed
    4. The diagonal is changed
  93. How many total elements must be there in a two-dimensional array of 3 rows and 2 columns?
    Topic: Arrays & Strings (40 MCQs)
    1. 4
    2. 5
    3. 6 ✓ Correct answer
    4. 7
  94. Which of the following is the correct way to assign an integer value 5 to an element of a matrix 'm' at the second row and third column?
    Topic: Arrays & Strings (40 MCQs)
    1. m[2][3] = 5;
    2. m[3][2] = 5;
    3. m[1][2] = 5; ✓ Correct answer
    4. m[2][3] = '5';
  95. Given a two-dimensional array of integers, what would be the correct way of assigning the value 6 to the element at the third row and fourth column?
    Topic: Arrays & Strings (40 MCQs)
    1. array[3][4] = 6;
    2. array[2][3] = 6; ✓ Correct answer
    3. array[4][3] = 6;
    4. array[3][3] = 6;
  96. Suppose we have int y[10]; To access the 4th element of the array we write:
    Topic: Arrays & Strings (40 MCQs)
    1. y[4];
    2. y[3]; ✓ Correct answer
    3. y[5];
    4. y(4);
  97. What will be the number of elements in the following array? int arr[29];
    Topic: Arrays & Strings (40 MCQs)
    1. 30
    2. 29 ✓ Correct answer
    3. 28
    4. 31
  98. What will be the correct syntax to initialize all elements of a two-dimensional array to the value 0?
    Topic: Arrays & Strings (40 MCQs)
    1. int arr[2][3] = {0,0};
    2. int arr[2][3] = {{0},{0}};
    3. int arr[2][3] = {0},{0};
    4. int arr[2][3] = {0}; ✓ Correct answer
  99. Consider the following code segment. What will it display? int main() { int age[10] = {0}; cout << age; }
    Topic: Arrays & Strings (40 MCQs)
    1. Values of all elements of the array
    2. Value of the first element of the array
    3. Starting address of the array ✓ Correct answer
    4. Address of the last array element
  100. The memory address of the first element of an array is called:
    Topic: Arrays & Strings (40 MCQs)
    1. Floor address
    2. Foundation address
    3. First address
    4. Base address ✓ Correct answer
  101. The name of the array is a constant pointer which contains the memory address of the ________ of the array.
    Topic: Arrays & Strings (40 MCQs)
    1. Last element
    2. First element ✓ Correct answer
    3. Middle element
    4. Largest element
  102. We want to access an array in random order; which of the following approaches is better?
    Topic: Arrays & Strings (40 MCQs)
    1. Pointers ✓ Correct answer
    2. Array index
    3. Both pointers and array index are better
    4. None of the given options
  103. Whenever some number is added to an array name, it will jump as many ________ as the added number.
    Topic: Arrays & Strings (40 MCQs)
    1. Rows
    2. Columns
    3. Elements ✓ Correct answer
    4. Bytes
  104. The element multi[3][3] can also be accessed by ________.
    Topic: Arrays & Strings (40 MCQs)
    1. *(*(multi+3)+3) ✓ Correct answer
    2. *(multi+3)+3
    3. *(*(multi+2)+2)
    4. multi[3+3]
  105. char name[] = "Hello world"; In the above statement, memory of ________ characters will be allocated.
    Topic: Arrays & Strings (40 MCQs)
    1. 11
    2. 12 ✓ Correct answer
    3. 10
    4. 13
  106. How many bytes are occupied by declaring the following array of characters? char str[] = "programming";
    Topic: Arrays & Strings (40 MCQs)
    1. 10
    2. 11
    3. 12 ✓ Correct answer
    4. 13
  107. What will be the size of the following character array? char name[] = "Adeel";
    Topic: Arrays & Strings (40 MCQs)
    1. 5
    2. 6 ✓ Correct answer
    3. 4
    4. 7
  108. Null character is represented in C++ by:
    Topic: Arrays & Strings (40 MCQs)
    1. \n
    2. \0 ✓ Correct answer
    3. \t
    4. \e
  109. The ASCII code of the null character is ________.
    Topic: Arrays & Strings (40 MCQs)
    1. 1
    2. 0 ✓ Correct answer
    3. 32
    4. 255
  110. Which character is inserted at the end of a string to indicate the end of the string?
    Topic: Arrays & Strings (40 MCQs)
    1. New line
    2. Tab
    3. Null ✓ Correct answer
    4. Carriage return
  111. The string in the array is terminated by a ________.
    Topic: Arrays & Strings (40 MCQs)
    1. Semicolon
    2. Null character ✓ Correct answer
    3. Space character
    4. New line character
  112. Null character is used to indicate the ________ of a string.
    Topic: Arrays & Strings (40 MCQs)
    1. Start
    2. End ✓ Correct answer
    3. Begin
    4. Middle
  113. Individual characters in a string stored in an array can be accessed directly using the array ________.
    Topic: Arrays & Strings (40 MCQs)
    1. Name
    2. Subscript ✓ Correct answer
    3. Pointer only
    4. Size
  114. A ________ is an array of characters that can store the number of characters specified.
    Topic: Arrays & Strings (40 MCQs)
    1. Integer array
    2. String ✓ Correct answer
    3. Structure
    4. Union
  115. For which array should the size of the array be one more than the number of elements in the array?
    Topic: Arrays & Strings (40 MCQs)
    1. int
    2. double
    3. float
    4. char ✓ Correct answer
  116. In C/C++, the string constant is enclosed:
    Topic: Arrays & Strings (40 MCQs)
    1. In curly braces
    2. In small braces
    3. In single quotes
    4. In double quotes ✓ Correct answer
  117. A pointer is a variable which stores:
    Topic: Pointers (15 MCQs)
    1. Data
    2. Memory address ✓ Correct answer
    3. Data type
    4. Values
  118. Pointers are a special type of ________ in which a memory address is stored.
    Topic: Pointers (15 MCQs)
    1. Constant
    2. Variable ✓ Correct answer
    3. Function
    4. Operator
  119. When a pointer is incremented, it actually jumps the number of memory addresses:
    Topic: Pointers (15 MCQs)
    1. According to its data type ✓ Correct answer
    2. 1 byte exactly
    3. 1 bit exactly
    4. A pointer variable cannot be incremented
  120. How many bytes will the pointer intPtr of type int move in the following statement? intPtr += 3;
    Topic: Pointers (15 MCQs)
    1. 3 bytes
    2. 6 bytes
    3. 12 bytes ✓ Correct answer
    4. 24 bytes
  121. How many bytes will an integer type pointer intPtr jump in memory if the following statement is executed? intPtr += 2;
    Topic: Pointers (15 MCQs)
    1. 2 bytes
    2. 4 bytes
    3. 8 bytes ✓ Correct answer
    4. 16 bytes
  122. Suppose an integer type pointer contains the memory address 0x22f220. What will be the new memory address if we increment this pointer by one?
    Topic: Pointers (15 MCQs)
    1. 0x22f221
    2. 0x22f224 ✓ Correct answer
    3. 0x22f228
    4. 0x22f220
  123. Which of the following operators is used to access the value of a variable pointed to by a pointer?
    Topic: Pointers (15 MCQs)
    1. * operator ✓ Correct answer
    2. -> operator
    3. && operator
    4. & operator
  124. To get the value stored at a memory address, we use the ________.
    Topic: Pointers (15 MCQs)
    1. Address operator
    2. Dereferencing operator ✓ Correct answer
    3. Reference operator
    4. Scope resolution operator
  125. The statement cout << yptr; will show the ________ the yptr points to.
    Topic: Pointers (15 MCQs)
    1. Value at
    2. Memory address ✓ Correct answer
    3. Data type of
    4. Name of
  126. char **argv can be read as:
    Topic: Pointers (15 MCQs)
    1. Pointer to char
    2. Pointer to pointer to char ✓ Correct answer
    3. Array of char
    4. Pointer to array of char
  127. ________ are the conventional names of the command line parameters of the main() function.
    Topic: Pointers (15 MCQs)
    1. 'argc' and 'argv' ✓ Correct answer
    2. 'args' and 'vars'
    3. 'count' and 'vector'
    4. 'main1' and 'main2'
  128. Which of the following is the correct statement for the following declaration? const int *ptr;
    Topic: Pointers (15 MCQs)
    1. ptr is a constant pointer
    2. ptr is a constant integer pointer
    3. ptr is a constant pointer to int
    4. ptr is a pointer to const int ✓ Correct answer
  129. Consider the following code segment. What will be the output? int arr[6] = {2, 3, 7, 4, 5, 6}; int *ptr1 = &arr[1]; int *ptr2 = &arr[4]; cout << (ptr2 - ptr1);
    Topic: Pointers (15 MCQs)
    1. 3 ✓ Correct answer
    2. 9
    3. 12
    4. 2
  130. What will be the correct syntax to assign an array named arr of 5 elements to a pointer ptr?
    Topic: Pointers (15 MCQs)
    1. *ptr = arr;
    2. ptr = arr; ✓ Correct answer
    3. *ptr = arr[5];
    4. ptr = arr[5];
  131. When an array element is passed to a function, it is passed by ________.
    Topic: Pointers (15 MCQs)
    1. Reference
    2. Data type
    3. Value ✓ Correct answer
    4. Data
  132. Structures are syntactically defined with the keyword ________.
    Topic: Structures & Unions (5 MCQs)
    1. struct ✓ Correct answer
    2. structure
    3. class
    4. union
  133. A record is a group of related ________.
    Topic: Structures & Unions (5 MCQs)
    1. Files
    2. Fields ✓ Correct answer
    3. Functions
    4. Arrays
  134. The syntax of a union is identical to ________.
    Topic: Structures & Unions (5 MCQs)
    1. Structure ✓ Correct answer
    2. Class
    3. Function
    4. None of the given options
  135. Dealing with structures and functions, passing by reference is the most economical method.
    Topic: Structures & Unions (5 MCQs)
    1. True ✓ Correct answer
    2. False
  136. The most efficient method of dealing with structure variables is to define the structure globally.
    Topic: Structures & Unions (5 MCQs)
    1. True
    2. False ✓ Correct answer
  137. C++ views each file as a sequential stream of ________.
    Topic: File Handling (13 MCQs)
    1. Bytes ✓ Correct answer
    2. Bits
    3. 0's or 1's
    4. Words
  138. We can read, write and manipulate the same file using ________.
    Topic: File Handling (13 MCQs)
    1. iostream.h
    2. fstream.h ✓ Correct answer
    3. conio.h
    4. stdio.h
  139. If a file is opened with the ios::out mode, then ________.
    Topic: File Handling (13 MCQs)
    1. The file is opened for reading
    2. A new file is created ✓ Correct answer
    3. Data is appended at the end
    4. The file pointer moves to the end
  140. Suppose we have a file with the name "myfile.txt". What will be the correct syntax of file opening for input?
    Topic: File Handling (13 MCQs)
    1. myFile.open("myfile.txt", ios::in); ✓ Correct answer
    2. myFile.open("myfile.txt", ios::out);
    3. myFile.open(myfile.txt, ios::in);
    4. open.myFile("myfile.txt");
  141. eof is used to check for the ________ of a file when a file is being read.
    Topic: File Handling (13 MCQs)
    1. Start
    2. End ✓ Correct answer
    3. Middle
    4. Size
  142. The ________ function gives the position of the next character to be read from a file.
    Topic: File Handling (13 MCQs)
    1. tellp()
    2. tellg() ✓ Correct answer
    3. seekg()
    4. seekp()
  143. We have opened a file stream myfile for reading. myfile.tellg() gives us the current get position of the file pointer. It returns a whole number of type ________.
    Topic: File Handling (13 MCQs)
    1. int
    2. long ✓ Correct answer
    3. float
    4. char
  144. The functions seekg() and seekp() require an argument of type ________ to let them know how many bytes to move forward or backward.
    Topic: File Handling (13 MCQs)
    1. int
    2. long ✓ Correct answer
    3. float
    4. double
  145. The function seekg() takes ________ parameter(s).
    Topic: File Handling (13 MCQs)
    1. 0
    2. 1
    3. 2 ✓ Correct answer
    4. 3
  146. The function write() takes ________ as parameter(s).
    Topic: File Handling (13 MCQs)
    1. String of pointer type
    2. String of variable length, number of bytes to be read and flags
    3. Pointer array of characters and a delimiter
    4. String and number of bytes to be written ✓ Correct answer
  147. While handling files, one can have ________ option(s).
    Topic: File Handling (13 MCQs)
    1. Read the file
    2. Write in some file
    3. Read and write in the same file
    4. All of the given options ✓ Correct answer
  148. An object of ________ can be created for saving the current position of any opened file before reading from the file.
    Topic: File Handling (13 MCQs)
    1. streampos ✓ Correct answer
    2. streambuf
    3. fstream
    4. filebuf
  149. In the statement aFile.seekg(-10L, ios::cur); the get pointer moves in the ________ direction.
    Topic: File Handling (13 MCQs)
    1. Forward
    2. Backward ✓ Correct answer
    3. No movement
    4. To the beginning of the file
  150. An instance of a class is called a/an ________.
    Topic: Classes, Dynamic Memory & Macros (17 MCQs)
    1. Structure
    2. Object ✓ Correct answer
    3. Function
    4. Pointer
  151. A constructor has ________.
    Topic: Classes, Dynamic Memory & Macros (17 MCQs)
    1. A different name from the class
    2. The same name as the class ✓ Correct answer
    3. No name
    4. The name of the object
  152. A default constructor takes ________.
    Topic: Classes, Dynamic Memory & Macros (17 MCQs)
    1. One parameter
    2. Two parameters
    3. No parameter ✓ Correct answer
    4. Any number of parameters
  153. In a class, we can have ________ constructor(s).
    Topic: Classes, Dynamic Memory & Macros (17 MCQs)
    1. Only one
    2. Many ✓ Correct answer
    3. Exactly two
    4. None
  154. For accessing data members, we use the ________ operator.
    Topic: Classes, Dynamic Memory & Macros (17 MCQs)
    1. Arrow (->)
    2. Dot (.) ✓ Correct answer
    3. Scope resolution (::)
    4. Asterisk (*)
  155. The friend functions are ________.
    Topic: Classes, Dynamic Memory & Macros (17 MCQs)
    1. Members of the class
    2. Not members of the class ✓ Correct answer
    3. Members of another program
    4. Built-in functions
  156. A friend function of a class is a function defined ________.
    Topic: Classes, Dynamic Memory & Macros (17 MCQs)
    1. Inside that class
    2. Outside that class and that has the right to access all members of the class ✓ Correct answer
    3. In the main function only
    4. In a header file only
  157. Initializing the data members within the class is ________ (in classic C++).
    Topic: Classes, Dynamic Memory & Macros (17 MCQs)
    1. Allowed
    2. A syntax error ✓ Correct answer
    3. Optional
    4. Recommended
  158. In C language, the region of memory allocated at run time is called the ________.
    Topic: Classes, Dynamic Memory & Macros (17 MCQs)
    1. Stack
    2. Heap ✓ Correct answer
    3. Queue
    4. Static area
  159. With the use of dynamic allocation of memory, the system resources can be ________.
    Topic: Classes, Dynamic Memory & Macros (17 MCQs)
    1. Wasted
    2. Used efficiently ✓ Correct answer
    3. Ignored
    4. Locked
  160. void *calloc(50, sizeof(int)) will return:
    Topic: Classes, Dynamic Memory & Macros (17 MCQs)
    1. A memory chunk of 50 integers from the stack
    2. A memory chunk of 50 integers from the heap ✓ Correct answer
    3. 50 bytes of memory
    4. An integer value of 50
  161. The calloc() function takes two arguments: the first argument is the ________ and the second argument is the ________.
    Topic: Classes, Dynamic Memory & Macros (17 MCQs)
    1. Size of each element, number of elements
    2. Number of elements, size of each element ✓ Correct answer
    3. Total bytes, address of memory
    4. Address of memory, total bytes
  162. The memory allocation in C++ is carried out with the help of the ________.
    Topic: Classes, Dynamic Memory & Macros (17 MCQs)
    1. malloc function
    2. new operator ✓ Correct answer
    3. alloc function
    4. calloc function
  163. The symbolic constant PI can be defined as:
    Topic: Classes, Dynamic Memory & Macros (17 MCQs)
    1. const PI = 3.14;
    2. #define PI 3.14 ✓ Correct answer
    3. PI := 3.14;
    4. define PI 3.14;
  164. A special name which is substituted in code by its definition, and as a result we get an expanded code, is called a ________.
    Topic: Classes, Dynamic Memory & Macros (17 MCQs)
    1. Function
    2. Macro ✓ Correct answer
    3. Variable
    4. Loop
  165. We can access a global variable ________.
    Topic: Classes, Dynamic Memory & Macros (17 MCQs)
    1. Only inside main()
    2. Only inside the function where it is declared
    3. From anywhere in the program ✓ Correct answer
    4. Only in the same file after main()
  166. Given the inline function: inline int max(int a, int b) { if (a > b) return a; return b; } In main(), x = 23 and y = 45, and the call max(x++, y++) is made. What will be the values of x and y after the call?
    Topic: Classes, Dynamic Memory & Macros (17 MCQs)
    1. x = 23, y = 45
    2. x = 24, y = 46 ✓ Correct answer
    3. x = 24, y = 45
    4. x = 23, y = 46
  167. Which programming tool is helpful in tracing the logical errors in a program?
    Topic: Additional MCQs from Paper Topics (9 MCQs)
    1. Compiler
    2. Debugger ✓ Correct answer
    3. Linker
    4. Loader
  168. What is the correct syntax of opening the file 'myFile.txt' in append ('app') mode using the ofstream variable 'out'?
    Topic: Additional MCQs from Paper Topics (9 MCQs)
    1. out.open("myFile.txt", ios::app); ✓ Correct answer
    2. out.open("myFile.txt", ios::out);
    3. open.out("myFile.txt", ios::app);
    4. out.append("myFile.txt");
  169. What is the result of the expression x = 2 + 3 * 4 - 4 / 2?
    Topic: Additional MCQs from Paper Topics (9 MCQs)
    1. 10
    2. 12 ✓ Correct answer
    3. 9
    4. 18
  170. What will be the output of the following code? int array[7], sum = 0; for (int i = 0; i < 7; i++) { array[i] = i; sum += array[i]; } cout << "Sum = " << sum;
    Topic: Additional MCQs from Paper Topics (9 MCQs)
    1. Sum = 28
    2. Sum = 21 ✓ Correct answer
    3. Sum = 15
    4. Sum = 7
  171. What will be the output of the following segment of C++ code? int A[5] = {1, 2, 3, 4}; for (int i = 0; i < 5; i++) { A[i] = 2 * A[i]; cout << A[i] << " "; }
    Topic: Additional MCQs from Paper Topics (9 MCQs)
    1. 1 2 3 4 0
    2. 2 4 6 8 0 ✓ Correct answer
    3. 2 4 6 8 10
    4. 0 2 4 6 8
  172. To which category of software do 'Compiler' and 'Interpreter' belong?
    Topic: Additional MCQs from Paper Topics (9 MCQs)
    1. Application software
    2. System software ✓ Correct answer
    3. Utility software
    4. Device drivers
  173. Suppose z is a variable of type int. What will be the result of z = 27 / 4?
    Topic: Additional MCQs from Paper Topics (9 MCQs)
    1. 6.75
    2. 6 ✓ Correct answer
    3. 7
    4. 3
  174. The statement seekg(-10L, ios::beg); contains an error because:
    Topic: Additional MCQs from Paper Topics (9 MCQs)
    1. seekg() cannot take two arguments
    2. A negative offset cannot be used with ios::beg (beginning of the file) ✓ Correct answer
    3. The offset must be of type int
    4. ios::beg is used only with seekp()
  175. A two-dimensional array arr has 3 rows and 4 columns. Which statements initialize the first element of all three rows with the value 2?
    Topic: Additional MCQs from Paper Topics (9 MCQs)
    1. arr[0][0] = 2; arr[1][0] = 2; arr[2][0] = 2; ✓ Correct answer
    2. arr[0][1] = 2; arr[0][2] = 2; arr[0][3] = 2;
    3. arr[1][0] = 2; arr[2][0] = 2; arr[3][0] = 2;
    4. arr[0][0] = 2; arr[0][1] = 2; arr[0][2] = 2;
  176. The name of a location in memory is called ______.
    Topic: Programming Basics & Program Design
    1. Constant
    2. Variable ✓ Correct answer
    3. Cell
    4. Number
  177. If x=11, and x%=3, than values of x will be
    Topic: Programming Basics & Program Design
    1. 4
    2. 2 ✓ Correct answer
    3. 6
    4. 8
  178. What is a key characteristic of an interpreter?
    Topic: Programming Basics & Program Design
    1. It creates a separate executable file from the source code
    2. It compiles the whole program into bytecode before running
    3. It only works with assembly language
    4. It executes code line-by-line at runtime ✓ Correct answer
  179. (x < 3) means in C++ that ______.
    Topic: Programming Basics & Program Design
    1. x is less than 3 ✓ Correct answer
    2. x is greater than or equal to 3
    3. x is greater than 3
    4. x is equal to 3
  180. Which of the following is a reserved word for data types in C/C++?
    Topic: Programming Basics & Program Design
    1. integer
    2. int ✓ Correct answer
    3. character
    4. doubles
  181. C was developed with the help of ______ language(s).
    Topic: Programming Basics & Program Design
    1. BCPL
    2. BCPL and B ✓ Correct answer
    3. none of the above
  182. C++ is a ______ language.
    Topic: Programming Basics & Program Design
    1. High level ✓ Correct answer
    2. Lowlevel
    3. Machine
    4. Fourth Generation
  183. We use ______ to include all those functions in our program which are located in different files.
    Topic: Programming Basics & Program Design
    1. Linker ✓ Correct answer
    2. Loader
    3. Compiler
    4. Debugger
  184. Mr. Ahmad sleeps thirty hours every day. This sentence is ______.
    Topic: Programming Basics & Program Design
    1. Grammatically incorrect
    2. Grammatically correct but illogical ✓ Correct answer
    3. Illogical and grammatically incorrect
    4. Logical and grammatically correct
  185. a= a +1; can be written as
    Topic: Programming Basics & Program Design
    1. a + 1;
    2. a += 1; ✓ Correct answer
    3. a + a + 1;
    4. 1 + a = a;
  186. A record is a group of related ______.
    Topic: Programming Basics & Program Design
    1. Data
    2. Fields ✓ Correct answer
    3. Bytes
    4. Files
  187. In shifting operations, if zero is inserted at the left most bit, the negative number will become a ______ number.
    Topic: Programming Basics & Program Design
    1. Positive ✓ Correct answer
    2. Negative
    3. Absolute
    4. Smaller
  188. Identify the logical error in the following if condition: if ((i < 5) && (i > 15))
    Topic: Programming Basics & Program Design
    1. Condition is always true
    2. Condition is always false ✓ Correct answer
    3. & will be used instead of &&
    4. && cannot be used with if condition
  189. Telling a computer what to do is called ______.
    Topic: Programming Basics & Program Design
    1. Designing
    2. Implementing
    3. Programming ✓ Correct answer
    4. Compiling
  190. Which of the following is not the sub-category of the system software?
    Topic: Programming Basics & Program Design
    1. Operating system
    2. Device drivers
    3. Utilities
    4. None of the above ✓ Correct answer
  191. We get ______ when 12 | 8 is evaluated, where | is the bit-wise OR operator.
    Topic: Programming Basics & Program Design
    1. 12 ✓ Correct answer
    2. 10
    3. 14
  192. Find out the logical error in the following lines of code: if (x = 10) cout << "x is 10";
    Topic: Programming Basics & Program Design
    1. 10 should be enclosed in quotations
    2. There is no semicolon at the end of if condition
    3. Assignment operator should not be used for comparison ✓ Correct answer
    4. Variable x should not be inside parenthesis
  193. ______ are used to compile the code.
    Topic: Programming Basics & Program Design
    1. Editors
    2. Debugger
    3. Linker
    4. Compiler ✓ Correct answer
  194. !(x > 3) means in C++ that ______.
    Topic: Programming Basics & Program Design
    1. x is less than 3
    2. x is less than or equal to 3 ✓ Correct answer
    3. x is greater than 3
  195. Computers can understand only ______ language code.
    Topic: Programming Basics & Program Design
    1. Machine ✓ Correct answer
    2. High level
    3. Natural
    4. Low level
  196. Why do we use "cin"?
    Topic: Programming Basics & Program Design
    1. To send data to printer
    2. To display output on the screen
    3. To display message
    4. To read data from keyboard ✓ Correct answer
  197. Compiler translates a high level language program into ______ language code.
    Topic: Programming Basics & Program Design
    1. C#
    2. Machine ✓ Correct answer
    3. Java
  198. Learning to program is important because it develops ______ and ______ abilities.
    Topic: Programming Basics & Program Design
    1. Analytical, writing
    2. Analytical, Problem solving ✓ Correct answer
    3. Reading, Writing
    4. Reading, Problem solving
  199. It is the job of ______ to transfer the executable code from hard disk to main memory.
    Topic: Programming Basics & Program Design
    1. Interpreter
    2. Debugger
    3. Linker
    4. Loader ✓ Correct answer
  200. Using a segment of source code again by adding new functionalities with minor or without modification is termed as
    Topic: Programming Basics & Program Design
    1. Code efficiency
    2. Code modification
    3. Code Generation
    4. Code Reusability ✓ Correct answer
  201. ______ is a precise sequence of steps to solve a particular problem.
    Topic: Programming Basics & Program Design
    1. Analysis
    2. Program ✓ Correct answer
    3. Code
    4. Statement
  202. if (a > b && a > c) then the condition will be true only if ______.
    Topic: Programming Basics & Program Design
    1. Both a > b and a > c are false
    2. a > b is false and a > c is true
    3. a > b is true and a > c is false
    4. Both a > b and a > c are true ✓ Correct answer
  203. Which one of the following is not a skill that we learn by designing programs?
    Topic: Programming Basics & Program Design
    1. Critical reading
    2. Creative synthesis
    3. Analytical thinking
    4. Hardware performance knowledge ✓ Correct answer
  204. ______ returns true if c is a letter and false otherwise.
    Topic: Programming Basics & Program Design
    1. int isalpha( int c ) ✓ Correct answer
    2. int isalnum( int c )
    3. int isdigit( int c )
    4. int isxdigit( int c )
  205. Which of the following is equivalent to *(yptr + 4)?
    Topic: Pointers
    1. *(yptr +3)
    2. yptr[3]
    3. *yptr + 4
    4. yptr[4] ✓ Correct answer
  206. Which of the following is not a reserved word in C/C++?
    Topic: Programming Basics & Program Design
    1. int
    2. float
    3. double
    4. sum ✓ Correct answer
  207. To access rand(), which library is required to be included in the program?
    Topic: Programming Basics & Program Design
    1. conio.h
    2. stdio.h
    3. stdlib.h ✓ Correct answer
    4. iostream.h
  208. While programming, it is good to provide an easy to understand and easy to use interface; this programming skill is called ______.
    Topic: Programming Basics & Program Design
    1. Scalability
    2. Usability ✓ Correct answer
    3. Reliability
    4. Sustainability
  209. Word processor is a type of a/an ______.
    Topic: Programming Basics & Program Design
    1. Operating system
    2. Application software ✓ Correct answer
    3. Device driver
    4. Utility software
  210. The ______ statement allows us to select from multiple choices based on a set of fixed values for a given expression.
    Topic: Programming Basics & Program Design
    1. switch ✓ Correct answer
    2. break
    3. continue
    4. goto
  211. C is widely known as the development language of the ______ operating system.
    Topic: Programming Basics & Program Design
    1. Windows
    2. Unix ✓ Correct answer
    3. Mac OS
    4. Linux
  212. In a flow chart, the flow of control is represented by ______.
    Topic: Programming Basics & Program Design
    1. Rectangle
    2. Circle
    3. Diamond
    4. Arrow ✓ Correct answer
  213. For clarity and to force the order of evaluation in an expression, we should use ______.
    Topic: Programming Basics & Program Design
    1. Brackets [ ]
    2. Parenthesis ( ) ✓ Correct answer
    3. Curly braces { }
    4. Quotation marks " "
  214. The statement x += y can be interpreted as ______.
    Topic: Programming Basics & Program Design
    1. Adding the value of y to the value of x and storing the result in x ✓ Correct answer
    2. Adding the value of x to the value of y and storing the result in y
    3. Subtracting the value of y from x and storing the result in x
    4. Multiplying the values of x and y and storing the result in x
  215. Correcting the errors from a program is termed as _____________.
    Topic: Programming Basics & Program Design
    1. Linking
    2. Loading
    3. Executing
    4. Debugging ✓ Correct answer
  216. What happens to comment statements during the compilation process?
    Topic: Programming Basics & Program Design
    1. They are ignored by the compiler ✓ Correct answer
    2. They cause syntax errors
    3. They are executed as logic
    4. They take up extra memory
  217. Which tools are used to formulate program statements in a precise language?
    Topic: Programming Basics & Program Design
    1. Pseudo code and flowcharting ✓ Correct answer
    2. Only hardware manuals
    3. Only compilers
    4. None of these
  218. Software is categorized into which two main categories?
    Topic: Programming Basics & Program Design
    1. Utility Software and System Software
    2. System Software and Application Software ✓ Correct answer
    3. Operating System and Device Drivers
    4. Application Software and Utility Software
  219. The _____ is responsible for controlling the allocation and usage of hardware resources.
    Topic: Programming Basics & Program Design
    1. Application Software
    2. Utility Software
    3. Device Driver
    4. Operating System ✓ Correct answer
  220. Which tool allows a programmer to control a program while it is running to find logical errors?
    Topic: Programming Basics & Program Design
    1. Preprocessor
    2. Loader
    3. Linker
    4. Debugger ✓ Correct answer
  221. The process of including routines and functions to make a standalone executable code is called
    Topic: Programming Basics & Program Design
    1. Debugging
    2. Linking ✓ Correct answer
    3. Preprocessing
    4. Loading
  222. In the program execution process, the _____ processes the code first.
    Topic: Programming Basics & Program Design
    1. Preprocessor ✓ Correct answer
    2. Loader
    3. Linker
    4. Compiler
  223. What is the starting point of every C program?
    Topic: Programming Basics & Program Design
    1. The main function ✓ Correct answer
    2. The first line of code
    3. The preprocessor
    4. None of these
  224. The compiler creates _____ code and stores it on the disk.
    Topic: Programming Basics & Program Design
    1. Object ✓ Correct answer
    2. Source
    3. Executable
    4. None of these
  225. Which symbol is used to enclose the blocks of a program in C?
    Topic: Programming Basics & Program Design
    1. ()
    2. {} ✓ Correct answer
    3. <>
    4. []
  226. The output stream _____ takes data from the computer and sends it to the monitor.
    Topic: Programming Basics & Program Design
    1. iostream
    2. printf
    3. cout ✓ Correct answer
    4. cin
  227. What is a pictorial representation of a program using geometrical symbols called?
    Topic: Programming Basics & Program Design
    1. Block
    2. Variable
    3. Flow chart ✓ Correct answer
    4. Syntax
  228. What is the primary purpose of using header files in a C program?
    Topic: Programming Basics & Program Design
    1. To increase the complexity of the program
    2. To store function prototypes and constants ✓ Correct answer
    3. To replace the main function body
    4. None of these
  229. Header files are typically simple text files with which extension?
    Topic: Programming Basics & Program Design
    1. .h ✓ Correct answer
    2. .txt
    3. .cpp
    4. .c
  230. Which directive is used to include a header file in a program?
    Topic: Programming Basics & Program Design
    1. #header
    2. #include ✓ Correct answer
    3. #define
    4. #import
  231. ______ will explain the function of a program.
    Topic: Programming Basics & Program Design
    1. Comments ✓ Correct answer
    2. Debugger
    3. Compiler
    4. Linker
  232. A variable declared within a code block becomes a ______ variable for that block.
    Topic: Data Types, Variables & Operators
    1. Static
    2. Integer
    3. Local ✓ Correct answer
    4. Global
  233. Which operator has the highest precedence in an expression?
    Topic: Data Types, Variables & Operators
    1. () ✓ Correct answer
    2. +
    3. %
    4. *
  234. A variable of character data type occupies - bytes in memory
    Topic: Data Types, Variables & Operators
    1. 0
    2. 2
    3. 1 ✓ Correct answer
    4. 3
  235. Which of the following is the correct operator to compare the values of two variables?
    Topic: Data Types, Variables & Operators
    1. =
    2. == ✓ Correct answer
    3. :=
    4. *=
  236. ______ of a variable means the locations within a program from where it can be accessed.
    Topic: Data Types, Variables & Operators
    1. Reference
    2. Visibility ✓ Correct answer
    3. Datatype
    4. Value
  237. Remainder operator (%) is a/an operator.
    Topic: Data Types, Variables & Operators
    1. Logical
    2. Relational
    3. Conditional
    4. Arithmetic ✓ Correct answer
  238. What will be the value of the variable output in the given piece of code? double output = 0; output = (2 + 2) * 4 + 2 / (4 - 2);
    Topic: Data Types, Variables & Operators
    1. 15
    2. 17 ✓ Correct answer
    3. 12
    4. 11
  239. What will be the value of 'a' and 'b' after executing the following statements? int a = 9; int b = a++; cout << a << b;
    Topic: Data Types, Variables & Operators
    1. 9, 9
    2. 10, 10
    3. 9, 10
    4. 10, 9 ✓ Correct answer
  240. What will be the output of the following code segment? char myName[] = "student ID"; int n = sizeof(myName); cout << n;
    Topic: Data Types, Variables & Operators
    1. 10
    2. 11 ✓ Correct answer
    3. 12
    4. 15
  241. After evaluating the expression X=10+3*4/2-1 the value of x will be
    Topic: Data Types, Variables & Operators
    1. 5
    2. 10
    3. 15 ✓ Correct answer
    4. 20
  242. Following is the declaration of a ______ array. int ar[2][2][2];
    Topic: Arrays & Strings
    1. 1-Dimensional
    2. 2-Dimensional
    3. 3-Dimensional ✓ Correct answer
    4. None of the given
  243. Which of the following options is correct to complete the declaration of the function? ______ functionName(parameter1, parameter2) { // code to be executed }
    Topic: Functions & References
    1. void functionName ✓ Correct answer
    2. int functionName;
    3. functionName void
    4. void (functionName)
  244. There is a pointer variable named ptr of type float. Which type of variable address can be stored by ptr?
    Topic: Data Types, Variables & Operators
    1. int
    2. float ✓ Correct answer
    3. char
    4. double
  245. X is an integer variable; what does X++ mean?
    Topic: Data Types, Variables & Operators
    1. Add 1 two times in X value
    2. Add 1 in X value ✓ Correct answer
    3. Add 2 in X value
    4. None of these
  246. = operator is used for ______.
    Topic: Data Types, Variables & Operators
    1. Decision making
    2. Assigning values to variables ✓ Correct answer
    3. Checking equality
    4. Comparison
  247. If int a = 50; then the value of a /= 3; will be ______.
    Topic: Data Types, Variables & Operators
    1. 15
    2. 18
    3. 16 ✓ Correct answer
  248. NOT operator is a ______.
    Topic: Data Types, Variables & Operators
    1. Single input operator ✓ Correct answer
    2. Binary operator
    3. Ternary operator
    4. None of the given
  249. < and > both are ______ operators.
    Topic: Data Types, Variables & Operators
    1. Arithmetic
    2. Relational ✓ Correct answer
    3. Logical
    4. Mathematical
  250. What will be the correct syntax of declaration of the following statement? "ptr is a pointer to const int"
    Topic: Data Types, Variables & Operators
    1. int const *ptr
    2. int *const ptr
    3. const int *ptr ✓ Correct answer
    4. const *int ptr
  251. Which operator uses the ^ sign?
    Topic: Data Types, Variables & Operators
    1. Bit-wise OR
    2. Exclusive OR ✓ Correct answer
    3. AND Operator
    4. NOT operator
  252. When the logical operator OR (||) combines two expressions exp1 and exp2, then the result will be false only ______.
    Topic: Data Types, Variables & Operators
    1. When exp1 is false and exp2 is true
    2. When exp1 is true and exp2 is false
    3. When both exp1 and exp2 are false ✓ Correct answer
    4. When both exp1 and exp2 are true
  253. What will be the values of variables x and y after executing the following code if x = 33 and y = 19? if (x % y != 0) x++; y--;
    Topic: Data Types, Variables & Operators
    1. X=22,y=14
    2. x=14,y=36
    3. x=34,y=18 ✓ Correct answer
    4. x=30,y=36
  254. What will be the result of arithmetic expression 6 + 48/4 * 3?
    Topic: Data Types, Variables & Operators
    1. 41
    2. 42 ✓ Correct answer
    3. 40.5
    4. 10
  255. Which of the following is the right syntax to declare a variable in C++?
    Topic: Data Types, Variables & Operators
    1. DataType VariableName; ✓ Correct answer
    2. (DataType)VariableName;
    3. DataType =VariableName;
    4. VariableName Datatype;
  256. If int sum = 54; then the value of the statement sum = sum - 3; is ______.
    Topic: Data Types, Variables & Operators
    1. 51 ✓ Correct answer
    2. 52
    3. 50
    4. 57
  257. What is the correct syntax of an array declaration, of double data type, for size 10 and initialized to value 0?
    Topic: Data Types, Variables & Operators
    1. arr[10] = [0.0];
    2. double arr[] = 0.0;
    3. double arr[10] = {0.0}; ✓ Correct answer
    4. double arr[10] = 0.0;
  258. Identify the correct option which is used for calling the function float area(int).
    Topic: Data Types, Variables & Operators
    1. area(&num);
    2. area(num); ✓ Correct answer
    3. area(int num);
    4. area(*num);
  259. Which of the following is not an example of int data type?
    Topic: Data Types, Variables & Operators
    1. -32
    2. 65531
    3. -4.0 ✓ Correct answer
  260. Which of the following can not be a variable name?
    Topic: Data Types, Variables & Operators
    1. area
    2. _area
    3. 10area ✓ Correct answer
    4. area2
  261. According to c++ norms, the first character of a variable name must be an alphabet or
    Topic: Data Types, Variables & Operators
    1. Underscore ✓ Correct answer
    2. Special character
    3. Digit
    4. None of the given options
  262. Which of the following will be the most appropriate data type to store the value 63.547?
    Topic: Data Types, Variables & Operators
    1. Integer
    2. Character
    3. Short
    4. Float ✓ Correct answer
  263. How much memory does the 'int' data type typically occupy?
    Topic: Data Types, Variables & Operators
    1. 1 byte
    2. 4 bytes ✓ Correct answer
    3. 2 bytes
    4. 8 bytes
  264. The 'short' data type has a size of _____ bytes.
    Topic: Data Types, Variables & Operators
    1. 2 ✓ Correct answer
    2. 8
    3. 4
    4. 1
  265. Which data type is used to store real numbers and uses four bytes?
    Topic: Data Types, Variables & Operators
    1. float ✓ Correct answer
    2. long
    3. double
    4. int
  266. If you need to store a very large real number that exceeds four bytes, you should use:
    Topic: Data Types, Variables & Operators
    1. double ✓ Correct answer
    2. int
    3. float
    4. short
  267. What is the result of the integer division 5 / 2 in C?
    Topic: Data Types, Variables & Operators
    1. 3
    2. 2.5
    3. 0
    4. 2 ✓ Correct answer
  268. The modulus operator (%) can only be used with _____ operands.
    Topic: Data Types, Variables & Operators
    1. double
    2. char
    3. float
    4. integer ✓ Correct answer
  269. Which data type range is -32768 to 32767?
    Topic: Data Types, Variables & Operators
    1. long
    2. int
    3. short ✓ Correct answer
    4. float
  270. Which of the following is NOT a valid way to write a C statement?
    Topic: Data Types, Variables & Operators
    1. x + 5 = y; ✓ Correct answer
    2. cout << x;
    3. int x = 5;
    4. x = 5 + 10;
  271. What happens to the decimal portion when two integers are divided in C?
    Topic: Data Types, Variables & Operators
    1. It is rounded down
    2. It is truncated ✓ Correct answer
    3. It is ignored
    4. It is rounded up
  272. The increment operator ++ is a _____ operator that increases the value of its operand by 1.
    Topic: Data Types, Variables & Operators
    1. binary
    2. ternary
    3. unary ✓ Correct answer
    4. None of these
  273. How many bits are used to store a single character in memory?
    Topic: Data Types, Variables & Operators
    1. 8 bits ✓ Correct answer
    2. 4 bits
    3. 16 bits
    4. 32 bits
  274. Which operator is used to access the data members of a structure variable?
    Topic: Structures & Unions
    1. &
    2. . ✓ Correct answer
    3. ->
    4. ::
  275. Which of the following is NOT a bitwise operator?
    Topic: Data Types, Variables & Operators
    1. && ✓ Correct answer
    2. &
    3. |
    4. ~
  276. How does the & operator differ from the && operator?
    Topic: Data Types, Variables & Operators
    1. & operates on bits while && operates on conditions ✓ Correct answer
    2. & returns true/false while && returns a bit pattern
    3. & operates on conditions while && operates on bits
    4. None of these
  277. The Exclusive OR operator (^) returns 1 when:
    Topic: Data Types, Variables & Operators
    1. Both bits are 1
    2. Both bits are 0
    3. One input is 0 and the other is 1 ✓ Correct answer
    4. None of these
  278. The _____ operator is a unary operator that inverts the bits of the input number.
    Topic: Data Types, Variables & Operators
    1. XOR
    2. NOT ✓ Correct answer
    3. OR
    4. AND
  279. Shifting a bit to the left in the binary system is equivalent to:
    Topic: Data Types, Variables & Operators
    1. Multiplying by 2 ✓ Correct answer
    2. Adding 2
    3. Dividing by 2
    4. None of these
  280. Shifting a bit to the right in the binary system is equivalent to:
    Topic: Data Types, Variables & Operators
    1. Dividing by 2 ✓ Correct answer
    2. Multiplying by 2
    3. Subtracting 2
    4. None of these
  281. If you right shift 12 twice, the result is:
    Topic: Data Types, Variables & Operators
    1. 6
    2. 3 ✓ Correct answer
    3. 24
    4. 48
  282. The != operator is used to check whether the operand on the left-hand side is ______ the operand on the right-hand side.
    Topic: Data Types, Variables & Operators
    1. Equal to
    2. Not equal to ✓ Correct answer
    3. Greater than
    4. Less than
  283. ______ variables are those that are defined outside of main.
    Topic: Data Types, Variables & Operators
    1. Local
    2. Global ✓ Correct answer
    3. Static
    4. Register
  284. If y = 20 and z = y++, then the value of z will be ______.
    Topic: Data Types, Variables & Operators
    1. 19
    2. 20 ✓ Correct answer
    3. 21
    4. 22
  285. What will be the output of the following code if the first case is true? switch (var) { case 'a': cout << "apple" << endl; case 'b': cout << "banana" << endl; case 'm': cout << "mango" << endl; default: cout << "any fruit" << endl; }
    Topic: Decision Structures (if & switch)
    1. none of above
    2. apple banana mango any fruit ✓ Correct answer
    3. apple
    4. apple any fruit
  286. What is the output of the following code if the 3rd case is true? switch (var) { case 'a': cout << "apple" << endl; case 'b': cout << "banana" << endl; case 'm': cout << "mango" << endl; default: cout << "any fruit" << endl; }
    Topic: Decision Structures (if & switch)
    1. mango
    2. mango any fruit ✓ Correct answer
    3. apple
    4. none of the above
  287. ______ statement is used to terminate the processing of a particular case and exit from the switch structure.
    Topic: Decision Structures (if & switch)
    1. if
    2. goto
    3. break ✓ Correct answer
    4. continue
  288. ______ construct is used to execute a set of instructions when a condition is true and another set when it is false.
    Topic: Decision Structures (if & switch)
    1. If
    2. else
    3. if/else ✓ Correct answer
    4. else/if
  289. Find the syntax error in the following piece of code: if (x > y); cout << "x is greater than y"; else cout << "y is greater than x";
    Topic: Decision Structures (if & switch)
    1. Braces not given for if and else blocks
    2. Semicolon should not be after the if statement ✓ Correct answer
    3. Condition in the if statement is wrong
    4. No error in the code
  290. When the if statement consists of more than one statement, then enclosing these statements in braces is ______.
    Topic: Decision Structures (if & switch)
    1. Relevant
    2. Not required
    3. Compulsory ✓ Correct answer
  291. Which of the following logical operators returns true only if both conditions are true?
    Topic: Decision Structures (if & switch)
    1. !(NOT)
    2. && (AND) ✓ Correct answer
    3. || (OR)
    4. == (Equality)
  292. ______ is a multiple-selection construct which makes the code more efficient and easy to read and understand.
    Topic: Decision Structures (if & switch)
    1. multiple-if
    2. switch ✓ Correct answer
    3. if-else
    4. else-if
  293. In a switch statement, the variable or expression must evaluate to which type?
    Topic: Decision Structures (if & switch)
    1. boolean
    2. string
    3. integer ✓ Correct answer
    4. float
  294. The _____ statement is executed if no case matches the value of the switch statement.
    Topic: Decision Structures (if & switch)
    1. break
    2. goto
    3. continue
    4. default ✓ Correct answer
  295. What happens if a break statement is missing in a switch case?
    Topic: Decision Structures (if & switch)
    1. The default case executes
    2. The program exits
    3. The program crashes
    4. The next case executes (fall through) ✓ Correct answer
  296. ______ loop is mostly used to perform repetition of tasks for a known number of times.
    Topic: Loops
    1. Nested Loop
    2. For ✓ Correct answer
    3. While
    4. Do-While
  297. A while loop may execute ______ or more times.
    Topic: Loops
    1. 1
    2. 0 ✓ Correct answer
    3. 2
    4. 3
  298. In a while loop, the loop counter is initialized ______.
    Topic: Loops
    1. Inside the loop
    2. Before entering the loop ✓ Correct answer
    3. After the loop
    4. At any place
  299. A ______ structure specifies that an action is to be repeated while some condition remains true.
    Topic: Loops
    1. Control
    2. Logical
    3. Repetition ✓ Correct answer
    4. Relational
  300. In a while loop, the condition is checked ______ the execution of the loop body.
    Topic: Loops
    1. After
    2. Before ✓ Correct answer
    3. At any time
    4. During
  301. When the break statement is encountered in a loop's body, it transfers the control ______ from the current loop.
    Topic: Loops
    1. Inside
    2. To continue statement
    3. To break statement
    4. Outside ✓ Correct answer
  302. What will be the output of the following while loop? int counter = 0; while (counter < 15) cout << counter << " "; counter++;
    Topic: Loops
    1. Infinite loop ✓ Correct answer
    2. Compile time error
    3. 12 3 4
    4. 123 4 5
  303. The condition in loop should be a(n)
    Topic: Loops
    1. Constant Expression
    2. Boolean Expression ✓ Correct answer
    3. Primary Expression
    4. Arithmetic Expression
  304. What is the correct syntax for a while loop?
    Topic: Loops
    1. while (statement1) { Logical Expression; }
    2. while (Logical Expression) { statement1; } ✓ Correct answer
    3. while (Logical Expression) statement1; statement2;
    4. while { Logical Expression } (statement1;)
  305. If you omit curly braces in a while loop, how many statements are repeated?
    Topic: Loops
    1. All statements until the end of main
    2. None of the statements
    3. Only the first statement after the while ✓ Correct answer
    4. All statements in the program
  306. What happens if you do not change the loop variable inside a while loop?
    Topic: Loops
    1. The program terminates
    2. A compile-time error occurs
    3. An infinite loop occurs ✓ Correct answer
    4. The loop executes only once
  307. Which loop structure ensures that a block of statements is executed at least once?
    Topic: Loops
    1. for loop
    2. while loop
    3. do-while loop ✓ Correct answer
    4. None of these
  308. What is the correct syntax for the do-while structure?
    Topic: Loops
    1. do ( condition ) { statement(s); };
    2. while ( condition ) { statement(s); } do;
    3. do while ( condition ) { statement(s); }
    4. do { statement(s); } while ( condition ); ✓ Correct answer
  309. What is the primary difference between while and do-while loops?
    Topic: Loops
    1. The use of variables
    2. The number of conditions
    3. The placement of the condition check ✓ Correct answer
    4. None of these
  310. What does the continue statement do in a for loop?
    Topic: Loops
    1. Starts the next iteration ✓ Correct answer
    2. Exits the switch
    3. Jumps to the beginning of the program
    4. Terminates the loop
  311. At the ______ phase, we try to break up the problem into functional units.
    Topic: Functions & References
    1. testing phase
    2. design phase ✓ Correct answer
    3. Implementation phase
    4. analysis phase
  312. The data type before a function name represents its,
    Topic: Functions & References
    1. Return Type ✓ Correct answer
    2. Function data
    3. Function arguments
    4. Function name
  313. When we call a function, its control ______.
    Topic: Functions & References
    1. transfers to its prototype
    2. transfers to its definition ✓ Correct answer
    3. returns to the statement following the function call
    4. The compiler stops execution of the whole program
  314. A function's prototype is written ______ the function call.
    Topic: Functions & References
    1. After
    2. Before ✓ Correct answer
    3. With
    4. At the end of
  315. To read command line argument the main() function itself must be given-
    Topic: Functions & References
    1. 1
    2. 2 ✓ Correct answer
    3. 3
    4. 4
  316. __________ contains functions for manipulations of character data.
    Topic: Functions & References
    1. Ctype.h ✓ Correct answer
    2. Iostream.h
    3. String.h
    4. None of the given
  317. The function write() takes as parameter(s)
    Topic: File Handling
    1. String of pointer type
    2. String of variable length, number of bytes to be read and last position
    3. Pointer, array of characters and a delimiter
    4. Character array and number of bytes to be written ✓ Correct answer
  318. _________ Keyword is used to return some value from a function.
    Topic: Functions & References
    1. Break
    2. Goto
    3. Continue
    4. Return ✓ Correct answer
  319. ______ function is used to find the number of characters in a string.
    Topic: Functions & References
    1. str()
    2. str_len()
    3. strlength()
    4. strlen() ✓ Correct answer
  320. In call by reference, ______ of a variable is passed to the called function.
    Topic: Functions & References
    1. Name
    2. Data type
    3. Value
    4. Address ✓ Correct answer
  321. A function is a block of statements that can be defined once and used ______ in the program.
    Topic: Functions & References
    1. One time
    2. Two times
    3. Three times
    4. As many times as user wants ✓ Correct answer
  322. From the following, which one is the range of the random number generator function rand()?
    Topic: Functions & References
    1. 0-32768
    2. 1-32768
    3. 0-32767 ✓ Correct answer
    4. 1-32767
  323. A program statement that invokes a function is called a ______.
    Topic: Functions & References
    1. Function declaration
    2. Function call ✓ Correct answer
    3. Function definition
    4. Function prototype
  324. Which one of the following functions is not included in the ctype.h header file?
    Topic: Functions & References
    1. isdigit(int c)
    2. isxdigit(int c)
    3. tolower(int c)
    4. getdigit(int c) ✓ Correct answer
  325. What will be the range of numbers generated by the function rand() % 9?
    Topic: Functions & References
    1. 0 to 9
    2. 1 to 9
    3. 0 to 8 ✓ Correct answer
    4. 1 to 8
  326. Preprocessor program perform its function before ______ phase takes place.
    Topic: Functions & References
    1. Editing
    2. Linking
    3. Compiling ✓ Correct answer
    4. Loading
  327. In C/C++, by default arguments are passed by ______ to a function.
    Topic: Functions & References
    1. Reference
    2. Value ✓ Correct answer
    3. Type
    4. Data
  328. Which of the following function calls is 'call by reference' for the following prototype? int add(int*);
    Topic: Functions & References
    1. add(&x) ✓ Correct answer
    2. add(int x);
    3. add(x);
    4. add(*x);
  329. Top-down designing mechanism is based on which principle?
    Topic: Functions & References
    1. Code reuse
    2. Information hiding
    3. Divide and conquer ✓ Correct answer
    4. Parallel processing
  330. What is the return_value_type for functions that do not return any value?
    Topic: Functions & References
    1. int
    2. empty
    3. void ✓ Correct answer
    4. null
  331. If no return_value_type is mentioned for a function, what is the default return type?
    Topic: Functions & References
    1. void
    2. float
    3. double
    4. int ✓ Correct answer
  332. The declaration of a function is also known as the _____.
    Topic: Functions & References
    1. Function prototype ✓ Correct answer
    2. Function call
    3. Function variable
    4. Function body
  333. What happens if you use a function without declaring it first?
    Topic: Functions & References
    1. The function is automatically defined
    2. The compiler ignores it
    3. The compiler gives an error ✓ Correct answer
    4. The program runs faster
  334. Which of these is a valid way to call a function?
    Topic: Functions & References
    1. result = square(5); ✓ Correct answer
    2. int square(5);
    3. square(5) = result;
    4. None of these
  335. A recursive function is a special type of function that can call _____.
    Topic: Functions & References
    1. itself ✓ Correct answer
    2. the main function
    3. another file
    4. none of these
  336. A recursive function must have a _____ case to indicate when the function will terminate.
    Topic: Functions & References
    1. final
    2. base ✓ Correct answer
    3. return
    4. stop
  337. Which function is used to initialize the random number generator with a different value?
    Topic: Functions & References
    1. srand() ✓ Correct answer
    2. time()
    3. rand()
    4. None of these
  338. Which function converts its uppercase letter argument into a lowercase letter?
    Topic: Functions & References
    1. toupper
    2. isdigit
    3. tolower ✓ Correct answer
    4. isalpha
  339. Which of the following function calls is 'call by value' for the following prototype? float add(int);
    Topic: Functions & References
    1. add(&x);
    2. add(x); ✓ Correct answer
    3. add(int x);
    4. add(*x);
  340. How can we declare an array of characters whose size is 12 with array name "country"?
    Topic: Arrays & Strings
    1. char country[12]; ✓ Correct answer
    2. char country[11];
    3. char[12] country;
    4. char country[0-11];
  341. When we access a multidimensional array, each array index is surrounded by ______.
    Topic: Arrays & Strings
    1. Commas
    2. Brackets [ ] ✓ Correct answer
    3. Single quotes
    4. Double quotes
  342. Following is an array of ____ rows and _____ columns. int num[3][4];
    Topic: Arrays & Strings
    1. 4 and 4
    2. 3 and 4 ✓ Correct answer
    3. 4 and 3
    4. 3 and 3
  343. Array indexes start from-
    Topic: Arrays & Strings
    1. 0 ✓ Correct answer
    2. 1
    3. 4
    4. 8
  344. ______ character is used to indicate the end of the string.
    Topic: Arrays & Strings
    1. Newline
    2. Blank space
    3. Null ✓ Correct answer
  345. What will be the output of the following code? string name[4] = {"Ali", "Bilal", "Omer", "Ayesha"}; cout << name[0];
    Topic: Arrays & Strings
    1. Ali ✓ Correct answer
    2. Bilal
    3. Omer.
    4. Ayesha
  346. Each array declaration must provide the information about all these things except ______.
    Topic: Arrays & Strings
    1. Name of the array
    2. Type of data stored in the array
    3. The location of the first element to be stored ✓ Correct answer
    4. Number of elements of the array
  347. What will be the output of the following code? string grade[3] = {"A", "B", "C"}; grade[2] = "F"; cout << grade[2];
    Topic: Arrays & Strings
    1. F ✓ Correct answer
    2. A
    3. C
    4. D
  348. Which of the following option is correct about array?
    Topic: Arrays & Strings
    1. Array is not used to store elements.
    2. Elements in an array cannot be sorted.
    3. Different types of elements can be stored in an array.
    4. Only one type of elements can be stored in an array ✓ Correct answer
  349. Suppose we have int y[10]; To access the 4th element of the array we write ______.
    Topic: Arrays & Strings
    1. y[2];
    2. y[4];
    3. y[3]; ✓ Correct answer
    4. none of given
  350. How do we declare an array of integer data whose size is 20 with array name "count"?
    Topic: Arrays & Strings
    1. int count[19];
    2. int count[20]; ✓ Correct answer
    3. float count[20];
    4. int count[21];
  351. ______ is an array of characters that can store the number of characters specified.
    Topic: Arrays & Strings
    1. Char
    2. String ✓ Correct answer
    3. Multidimensional array
    4. Datatype
  352. Declaration of a two-dimensional array of integers having 3 rows and 5 columns is ______.
    Topic: Arrays & Strings
    1. int arr[3][5]; ✓ Correct answer
    2. int arr(5, 3);
    3. int [3], [5] arr;
    4. int arr[5][3];
  353. If an array has 50 elements, what is the allowable range of subscripts?
    Topic: Arrays & Strings
    1. 0-49 ✓ Correct answer
    2. 1-49
    3. 0-50
    4. 1-50
  354. In case of a two-dimensional array, if you add some number in the two-dimensional array name, it will jump to the next ______.
    Topic: Arrays & Strings
    1. row ✓ Correct answer
    2. column
    3. character.
    4. array
  355. We want to access an array in random order; which of the following approaches is better?
    Topic: Arrays & Strings
    1. Pointers ✓ Correct answer
    2. Array index
    3. Both pointers and array index are better
    4. None of the given
  356. Which function is used to locate the first occurrence of a character in a string?
    Topic: Arrays & Strings
    1. strchr() ✓ Correct answer
    2. strstr()
    3. strtok()
    4. strlen()
  357. How many bytes are occupied by declaring the following array of characters? char str[] = "programming";
    Topic: Arrays & Strings
    1. 10
    2. 11
    3. 12 ✓ Correct answer
    4. 13
  358. To be able to copy one array into another, what must be true?
    Topic: Arrays & Strings
    1. Same data type but different size
    2. Different data type but same size
    3. Same data type and same size ✓ Correct answer
    4. None of these
  359. The size of a character array should be _____ more than the number of characters you want to store.
    Topic: Arrays & Strings
    1. one ✓ Correct answer
    2. zero
    3. two
    4. none of these
  360. Binary search algorithm only applies to arrays that are _____.
    Topic: Arrays & Strings
    1. sorted ✓ Correct answer
    2. unsorted
    3. empty
    4. none of these
  361. To pass an array to a function, you must pass the name of the array and the _____ of the array.
    Topic: Arrays & Strings
    1. index
    2. type
    3. size ✓ Correct answer
    4. address
  362. When passing an array to a function, the _____ of the array is passed.
    Topic: Arrays & Strings
    1. address ✓ Correct answer
    2. copy
    3. value
    4. none of these
  363. How do you access an element in a two-dimensional array?
    Topic: Arrays & Strings
    1. a[row][col] ✓ Correct answer
    2. a[row, col]
    3. a(row, col)
    4. a[col][row]
  364. When passing a 2D array to a function, you must specify the _____.
    Topic: Arrays & Strings
    1. data type
    2. number of rows
    3. number of columns ✓ Correct answer
    4. total size
  365. All string manipulation functions are defined in which header file?
    Topic: Arrays & Strings
    1. stdlib.h
    2. ctype.h
    3. iostream.h
    4. string.h ✓ Correct answer
  366. Which function appends string s2 to array s1, overwriting s1's null character?
    Topic: Arrays & Strings
    1. strlen
    2. strcpy
    3. strcat ✓ Correct answer
    4. strcmp
  367. If s1 < s2, the strcmp function returns a _____ number.
    Topic: Arrays & Strings
    1. negative ✓ Correct answer
    2. null
    3. positive
    4. zero
  368. The atoi function converts a string to a _____.
    Topic: Arrays & Strings
    1. int ✓ Correct answer
    2. double
    3. char
    4. long
  369. Which function compares up to n characters of two strings?
    Topic: Arrays & Strings
    1. strncat
    2. strcmp
    3. strncpy
    4. strncmp ✓ Correct answer
  370. Which function is used to convert a string to a double?
    Topic: Arrays & Strings
    1. atof ✓ Correct answer
    2. atol
    3. atoi
    4. None of these
  371. In the transpose of a matrix, the first row becomes the ______.
    Topic: Arrays & Strings
    1. Last column
    2. First column ✓ Correct answer
    3. First row
    4. Diagonal
  372. How much space does the null character '\0' take in the memory?
    Topic: Arrays & Strings
    1. 0 bytes
    2. 1 byte ✓ Correct answer
    3. 2 bytes
    4. 4 bytes
  373. Base address is the memory address of the ______ element of an array.
    Topic: Pointers
    1. 1st ✓ Correct answer
    2. 3rd
    3. 4th
    4. 2nd
  374. Pointer points to a particular
    Topic: Pointers
    1. Value
    2. Variable
    3. Data type
    4. Memory address ✓ Correct answer
  375. In the case of pointer to pointer or __________, the first pointer contains the address of the second pointer, which contains the address of the variable, which contains the desired value.
    Topic: Pointers
    1. Different
    2. Float and double
    3. Single dereference
    4. Double dereference ✓ Correct answer
  376. dereferencing operator is represented by _______
    Topic: Pointers
    1. +
    2. * ✓ Correct answer
    3. -
    4. None
  377. char **argv can be read as ______.
    Topic: Pointers
    1. Pointer to Pointer
    2. Pointer to Char
    3. Pointer to Pointer to Char ✓ Correct answer
    4. None of the given
  378. The name of the array is a constant pointer which contains the memory address of the ______ of the array.
    Topic: Pointers
    1. First element ✓ Correct answer
    2. Last element
    3. Second element
    4. None of the given
  379. Which of the following is a correct way to assign the address of the first element of array to pointer? int data[10];
    Topic: Pointers
    1. int *ptr = data; ✓ Correct answer
    2. int *ptr = &data;
    3. int *ptr = data[0];
    4. int *ptr = data[2];
  380. The increment of a pointer depends on its___________.
    Topic: Pointers
    1. Values
    2. Variable
    3. Data type ✓ Correct answer
    4. None of the given
  381. What is the output of the following code? int data[10] = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100}; int *xptr = &data[4]; int *yptr = &data[6]; cout << xptr + yptr++;
    Topic: Pointers
    1. 110
    2. 120
    3. 130
    4. Syntax error ✓ Correct answer
  382. The _____ operator is used in C to get the address of a variable.
    Topic: Pointers
    1. %
    2. & ✓ Correct answer
    3. #
    4. *
  383. The _____ operator is used to get the value stored at a memory address.
    Topic: Pointers
    1. address
    2. logical
    3. assignment
    4. dereferencing ✓ Correct answer
  384. The statement int *const myptr = &x declares:
    Topic: Pointers
    1. A pointer to a constant integer
    2. A constant pointer to a constant integer
    3. A constant pointer to an integer ✓ Correct answer
    4. None of these
  385. The statement const int *myptr = &x describes:
    Topic: Pointers
    1. A pointer to a constant integer ✓ Correct answer
    2. A constant pointer to a constant integer
    3. A constant pointer to an integer
    4. None of these
  386. If you declare int *ptr = 0, what is the pointer called?
    Topic: Pointers
    1. An integer pointer
    2. A dangling pointer
    3. A null pointer ✓ Correct answer
    4. None of these
  387. What does the statement *num = 5 do if num is a pointer?
    Topic: Pointers
    1. Assigns 5 to the pointer variable
    2. Assigns 5 to the address of the pointer
    3. Assigns 5 to the memory location pointed to by num ✓ Correct answer
    4. None of these
  388. Which of the following is a correct way to declare a pointer to a double?
    Topic: Pointers
    1. ptr *double;
    2. *double ptr;
    3. double *ptr; ✓ Correct answer
    4. double ptr;
  389. The expression (*yptr)++ is read as:
    Topic: Pointers
    1. Decrement the value at yptr
    2. Increment the value yptr points to ✓ Correct answer
    3. Increment the pointer address
    4. None of these
  390. What happens if you try to add two pointers together in C?
    Topic: Pointers
    1. It adds the values stored
    2. The compiler shows an error ✓ Correct answer
    3. It returns the total address
    4. None of these
  391. If an integer occupies 4 bytes, incrementing an integer pointer will increase its address by _____ bytes.
    Topic: Pointers
    1. 4 ✓ Correct answer
    2. 2
    3. 1
    4. None of these
  392. If yptr points to the first element of an array of integers, what does yptr++ do?
    Topic: Pointers
    1. Points to the second element of the array ✓ Correct answer
    2. Points to the previous memory address
    3. Increments the value of the first element
    4. None of these
  393. If you have two pointers to the same integer array, what does subtracting them return?
    Topic: Pointers
    1. The sum of their addresses
    2. The number of array elements between them ✓ Correct answer
    3. The number of bytes between them
    4. None of these
  394. Which of these is a valid way to access the 6th element of an array y using a pointer yptr?
    Topic: Pointers
    1. *(yptr + 5) ✓ Correct answer
    2. *(yptr + 6)
    3. yptr(5)
    4. None of these
  395. What is the result of (yptr2 - yptr1) if yptr1 points to index 0 and yptr2 points to index 3?
    Topic: Pointers
    1. 1
    2. 3 ✓ Correct answer
    3. 2
    4. None of these
  396. What is the nature of an array name when used as a pointer?
    Topic: Pointers
    1. A pointer to pointer
    2. A variable pointer
    3. A constant pointer ✓ Correct answer
    4. None of these
  397. What is the result of '**multi' for a two-dimensional array?
    Topic: Pointers
    1. The value of the first element ✓ Correct answer
    2. The address of the array
    3. The address of the first row
    4. None of these
  398. Suppose that an integer pointer contains the memory address 0x22f220. What will be the new memory address if we increment this pointer by one?
    Topic: Pointers
    1. 0x22f221
    2. 0x22f222
    3. 0x22f223
    4. 0x22f224 ✓ Correct answer
  399. Which is not true regarding structures?
    Topic: Structures & Unions
    1. We can declare arrays of structure
    2. We can take the sizeof structure
    3. We can't declare pointers to structure ✓ Correct answer
    4. Both b & c
  400. A structure is a collection of _____________under a single name.
    Topic: Structures & Unions
    1. Array
    2. Pointer
    3. Datatype
    4. Variables ✓ Correct answer
  401. Which is the correct syntax to define a structure named 'student'?
    Topic: Structures & Unions
    1. structure student { // variables }
    2. struct student { // variables } ✓ Correct answer
    3. structure student // variables
    4. struct student // variables
  402. When accessing a structure member, the identifier to the left of the dot operator is the name of ______.
    Topic: Structures & Unions
    1. Structure variable ✓ Correct answer
    2. Structure member
    3. Structure tag
    4. Structure data
  403. The syntax of ______ is identical to the syntax of a structure.
    Topic: Structures & Unions
    1. union ✓ Correct answer
    2. class
    3. function
    4. loop
  404. A structure is a collection of variables under a single name. These variables are called:
    Topic: Structures & Unions
    1. Union members
    2. Class members
    3. Function members
    4. Data members ✓ Correct answer
  405. What is the correct syntax to declare an array of 100 student structures?
    Topic: Structures & Unions
    1. student[100] s;
    2. array<student> s(100);
    3. s student[100];
    4. student s[100]; ✓ Correct answer
  406. When assigning one structure to another (e.g., s1 = s2), what happens?
    Topic: Structures & Unions
    1. Only the address is copied
    2. All data members are copied ✓ Correct answer
    3. Only the first member is copied
    4. The assignment fails
  407. If 'sptr' is a pointer to a structure, which syntax is used to access a member?
    Topic: Structures & Unions
    1. sptr::member
    2. sptr.member
    3. sptr->member ✓ Correct answer
    4. sptr[member]
  408. How much memory is allocated to a union?
    Topic: Structures & Unions
    1. Fixed 4 bytes
    2. Size of the largest member ✓ Correct answer
    3. Size of the smallest member
    4. Sum of all members
  409. What is the primary difference between a structure and a union?
    Topic: Structures & Unions
    1. Structures are smaller
    2. Structures share memory
    3. Unions share memory ✓ Correct answer
    4. Unions have more members
  410. If you have 'student s[100]', what is the correct way to access the name of the first student?
    Topic: Structures & Unions
    1. s[0].name ✓ Correct answer
    2. s.name
    3. s[1].name
    4. s.name[0]
  411. If an integer is 4 bytes and a char is 1 byte, what is the size of a union containing both?
    Topic: Structures & Unions
    1. 8 bytes
    2. 1 byte
    3. 4 bytes ✓ Correct answer
    4. 5 bytes
  412. If you have a pointer 'sptr' to a structure, what is the correct alternative to 'sptr->name'?
    Topic: Structures & Unions
    1. sptr(name)
    2. sptr.name
    3. *sptr.name
    4. (*sptr).name ✓ Correct answer
  413. In ______, we have different data members and all of these have their own memory space.
    Topic: Structures & Unions
    1. Structures ✓ Correct answer
    2. Unions
    3. Classes
    4. Functions
  414. ofstream is used for ______.
    Topic: File Handling
    1. Input file stream
    2. Output file stream ✓ Correct answer
    3. Input and output file stream
    4. All of the given
  415. A file opened with ____ is used for input and cannot be used for output.
    Topic: File Handling
    1. ifstream ✓ Correct answer
    2. Ostream
    3. Istream
    4. Fstream
  416. Which of the following is not a file opening mode?
    Topic: File Handling
    1. ios::in
    2. ios::out
    3. ios::ate
    4. ios::truncate ✓ Correct answer
  417. Which statement is used to close a file?
    Topic: File Handling
    1. myFile.off();
    2. myFile.shut();
    3. myFile.close(); ✓ Correct answer
    4. myFile.closefile();
  418. ______ is used for input file or for reading from the file.
    Topic: File Handling
    1. tellg() ✓ Correct answer
    2. seekg()
    3. tellp()
    4. seekp()
  419. We have opened a file stream myfile for reading (getting). myfile.tellg() gives us the current get position of the file pointer. It returns a whole number of type ______.
    Topic: File Handling
    1. long ✓ Correct answer
    2. int
    3. short
    4. double
  420. Which of the following is the default mode of opening using the ofstream class?
    Topic: File Handling
    1. ios::in
    2. ios::out ✓ Correct answer
    3. ios::app
    4. ios::trunc
  421. If a file is opened with ios::out mode, then ______.
    Topic: File Handling
    1. File is deleted
    2. We can write in this file ✓ Correct answer
    3. Content of file is discarded
    4. A new file is created
  422. ______ function gives the position of the next character to be read from that file.
    Topic: File Handling
    1. tellp()
    2. tellg() ✓ Correct answer
    3. seekg()
    4. seekp()
  423. ______ function is used to determine the next position to write a character while writing into a file.
    Topic: File Handling
    1. tellg()
    2. seekg()
    3. seekp()
    4. tellp() ✓ Correct answer
  424. eof is used to check for the ______ of file when a file is being read.
    Topic: File Handling
    1. Start
    2. End ✓ Correct answer
    3. Middle
    4. Name
  425. ______ is used for output during the process of writing to the file.
    Topic: File Handling
    1. seekg()
    2. tellg()
    3. seekp() ✓ Correct answer
    4. tellp()
  426. Which header file must be included to use the functions tolower() and toupper()?
    Topic: File Handling
    1. iostream.h
    2. stdlib.h
    3. conio.h
    4. ctype.h ✓ Correct answer
  427. Which mode is used to open a file or stream for extraction (input)?
    Topic: File Handling
    1. ios::in ✓ Correct answer
    2. ios::out
    3. ios::ate
    4. ios::app
  428. ______ is the pointer which determines the position in a file from where the next read operation occurs.
    Topic: File Handling
    1. put
    2. seek
    3. get ✓ Correct answer
    4. tell
  429. Which of the following header file include string conversion functions?
    Topic: File Handling
    1. string.h
    2. stdlib.h ✓ Correct answer
    3. ctype.h
    4. sconvert.h
  430. Which header file is required to use file streams in a C++ program?
    Topic: File Handling
    1. <string.h>
    2. <iostream.h>
    3. <fstream.h> ✓ Correct answer
    4. None of these
  431. The _____ function is used to read a single character from a file.
    Topic: File Handling
    1. put()
    2. getline()
    3. get() ✓ Correct answer
    4. None of these
  432. If you open a file with ios::app mode, where will the data be written?
    Topic: File Handling
    1. At the start
    2. At the end ✓ Correct answer
    3. Replaces everything
    4. None of these
  433. What is the primary characteristic of sequential access files?
    Topic: File Handling
    1. They are read and written in a sequence ✓ Correct answer
    2. They allow random jumping to any position
    3. They store data only in binary format
    4. None of these
  434. How do you determine the actual data length of a file?
    Topic: File Handling
    1. Using tellp() only
    2. Using seekp(0, ios::beg) and tellp()
    3. Using seekg(0, ios::end) and tellg() ✓ Correct answer
    4. None of these
  435. To move 10 bytes forward from the beginning, which code is correct?
    Topic: File Handling
    1. aFile.seekg(10L, ios::beg) ✓ Correct answer
    2. aFile.seekg(10L, ios::end)
    3. aFile.seekg(10L, ios::cur)
    4. None of these
  436. What is the use of ios::trunc mode?
    Topic: File Handling
    1. To open a file in input mode
    2. To open a file in output mode
    3. To truncate an existing file to half
    4. To truncate an existing file to zero ✓ Correct answer

MIHORA VU – Virtual University Assignment Solutions 2026, Solved Past Papers & All 455+ Courses

Official MIHORA TECH academic repository offering 28,328+ verified study documents for all 455+ Virtual University of Pakistan courses. Access VU Assignment Solution 2026 (Latest Session), Moaaz & Waqar Siddhu solved midterm & final papers, lecture handouts, and quizzes with 100% direct high-speed links.

SPRING 2026 / FALL 2026 ACTIVE SESSION

VU Assignment Solution 2026 (Latest Solved Assignments, GDBs & Quizzes)

Get high-scoring solutions for Assignment 1, Assignment 2, and Graded Discussion Boards across Computer Science, Mathematics, Management, English, and Economics. Compliant with Turnitin similarity limits (< 19%) and official 24-hour grace periods.

Open VU Assignment Solution 2026 Hub →

Popular Virtual University Courses (2026 Solved Papers & Solutions):

CS101 – Introduction to Computing CS201 – Introduction to Programming CS301 – Data Structures CS302 – Digital Logic Design CS401 – Computer Architecture & Assembly Language CS402 – Theory of Automata CS403 – Database Management Systems CS501 – Advance Computer Architecture CS502 – Fundamentals of Algorithms CS504 – Software Engineering - I CS506 – Enterprise Application Development CS601 – Data Communication CS602 – Computer Graphics CS604 – Operating Systems CS605 – Software Engineering - II CS607 – Artificial Intelligence CS610 – Computer Networks CS619 – Final Year Project MTH101 – Calculus & Analytical Geometry MTH202 – Discrete Mathematics MTH301 – Calculus II (Multivariable Calculus) MTH302 – Business Mathematics & Statistics MTH501 – Linear Algebra ENG101 – English Comprehension ENG201 – Business and Technical English Writing MGT101 – Financial Accounting MGT211 – Introduction to Business MGT301 – Principles of Marketing MGT501 – Human Resource Management ACC311 – Fundamentals of Auditing ACC501 – Business Finance STA301 – Statistics and Probability ECO401 – Economics (Micro & Macro) ISL202 – Islamic Studies / Ethics PAK301 – Pakistan Studies PHY101 – Physics - Mechanics & Waves

Complete Directory of All 455 Virtual University Courses & Codes

Browse the complete curriculum of all 455 accredited courses across 27 faculties of Virtual University of Pakistan. Every course includes verified lecture handouts, Moaaz & Waqar Siddhu solved papers, and 2026 assignment solution templates.

Accounting & Finance (16 Courses)

ACC301 – Financial Accounting ACC311 – Fundamentals of Auditing ACC501 – Business Finance BNK601 – Banking Laws & Practices BNK603 – Consumer Banking BNK604 – Commercial Banking BNK610 – Credit & Risk Management in Banking EFIN623 – Economics of Financial Markets FIN611 – Advanced Financial Accounting FIN621 – Financial Statement Analysis FIN622 – Corporate Finance FIN623 – Taxation Management FIN624 – Islamic Banking & Finance FIN625 – Credit & Risk Management FIN630 – Investment Analysis & Portfolio Management FIN722 – Advanced Corporate Finance

Bioinformatics (7 Courses)

BIF101 – Basic Bioinformatics BIF401 – Introduction to Bioinformatics BIF402 – Computational Biology Methods BIF501 – Genomics & Proteomics BIF601 – Bioinformatics Algorithms BIF602 – Structural Bioinformatics BIF604 – Systems Biology

Biological Sciences (16 Courses)

BIO101 – Basic Biology BIO102 – Introductory Biology & Diversity BIO201 – Cell Biology BIO202 – Biochemistry BIO203 – General Genetics BIO204 – Biochemical Techniques BIO301 – Molecular Biology BIO302 – Animal Physiology BIO303 – Developmental Biology BIO401 – Ecology & Evolutionary Biology BIO502 – Immunology & Pathology BIO503 – Pharmacology & Toxicology BIO504 – Applied Microbiology BIO505 – Environmental Biotechnology BIO506 – Forensic Biology BIO731 – Advanced Molecular Genetics

Virtual University of Pakistan (43 Courses)

BNK611 – Economic Ideology in Islam BT613T – Agricultural Biotechnology CS306 – Introduction to Python CS441 – Big Data Concepts CS442 – Introduction to Data Science CS620 – Modeling & Simulation CS701 – Theory of Computation CS703 – Operating Systems CS704 – Advanced Computer Architecture ECO302 – Microeconomics EDU407 – EDU407 ENG401 – Introduction to Literature: Short Story and Poetry GSC201 – Teaching of General Science MCM516 – TV News Reporting and Production MGMT611 – Human Relations MGMT629 – Crisis Management MGT201 – Financial Management MGT401 – Financial Accounting II MGT404 – MGT404 MGT504 – Organization Theory & Design MGT520 – International Business MGT522 – MGT522 MGT601 – SME Management MGT603 – Strategic Management MGT613 – Production and Operations Management MGT703 – Strategic Management MGT705 – Advanced Cost and Management Accounting MGT713 – Production / Operations Management MTH102 – Basic Algebra and Trigonometry MTH201 – Multivariable Calculus MTH304 – Mechanics MTH403 – MTH403 MTH404 – MTH404 MTH405 – MTH405 MTH621 – Real Analysis I MTH633 – Group Theory MTH642 – Fluid Mechanics MTH643 – MTH643 PAK303 – PAK303 PSC401 – Public International Law PSY409 – Positive Psychology SE601 – Software Construction & Development SE602 – Software Re—engineering

Bio-Technology (34 Courses)

BT101 – Ecology, Biodiversity & Evolution BT102 – Microbiology BT201 – Biotechnology Fundamentals BT301 – Recombinant DNA Technology BT302 – Cell and Tissue Culture BT401 – Genetic Engineering BT402 – Fermentation Technology BT403 – Agricultural Biotechnology BT404 – Medical Biotechnology BT405 – Industrial Biotechnology BT406 – Nanobiotechnology BT501 – Biochemical Engineering BT502 – Biosafety & Bioethics BT503 – Molecular Diagnostics BT504 – Stem Cell Technology BT505 – Food Biotechnology BT511 – Vaccine Technology BT512 – Drug Design & Development BT513 – Genomics & Functional Proteomics BT514 – Enzyme Technology BT601 – Advanced Genetic Engineering BT602 – Bioinformatics in Biotechnology BT603 – Bioprocess Engineering BT604 – Aquatic Biotechnology BT605 – Environmental Bioremediation BT611 – Synthetic Biology BT612 – Metabolic Engineering BT613 – Biofuels and Bioenergy BT614 – Clinical Research in Biotechnology BT693 – Research Project in Biotechnology BT732 – Advanced Molecular Biology Seminar BT734 – Advanced Cellular Biotechnology BT735 – Current Topics in Biotechnology NTBT301 – Nanotechnology in Biotechnology

Chemistry (2 Courses)

CHE201 – General Chemistry CHE301 – Organic Chemistry

Computer Science (55 Courses)

CS000 – Introduction to Computer Fundamentals CS001 – Computer Proficiency License CS101 – Introduction to Computing CS201 – Introduction to Programming CS202 – Web Design & Development CS204 – Cyber Law & Intellectual Property CS205 – Information Security Management CS206 – Ethical Hacking & Defense CS301 – Data Structures CS302 – Digital Logic Design CS304 – Object Oriented Programming CS310 – Introduction to Programming (Python) CS311 – Introduction to Web Services Development CS312 – Mobile Application Development CS314 – Embedded Systems & IoT CS315 – Web Engineering CS401 – Computer Architecture & Assembly Language CS402 – Theory of Automata CS403 – Database Management Systems CS405 – Mobile Computing CS407 – Cloud Computing Fundamentals CS408 – Human Computer Interaction CS409 – Ethical & Legal Issues in Computing CS410 – Design & Analysis of Algorithms CS411 – Visual Programming CS420 – Game Design and Development CS432 – Network Security CS435 – Cloud Computing Infrastructure CS501 – Advance Computer Architecture CS502 – Fundamentals of Algorithms CS505 – Agile Software Development CS506 – Enterprise Application Development CS507 – Information Systems CS508 – Modern Programming Languages CS510 – Compiler Construction CS511 – Distributed Systems CS521 – Data Science Principles CS601 – Data Communication CS602 – Computer Graphics CS603 – Software Architecture CS604 – Operating Systems CS606 – Compiler Design & Construction CS607 – Artificial Intelligence CS608 – Digital Signal Processing CS609 – System Programming CS610 – Computer Networks CS614 – Data Warehousing CS619 – Final Year Project CS621 – Information Retrieval Techniques CS625 – Formal Methods in Software Engineering CS627 – Computer Vision & Pattern Recognition CS636 – Big Data Analytics CS708 – Advanced Computer Graphics CS713 – Advanced Software Architecture CS718 – Advanced Artificial Intelligence

Software Engineering (4 Courses)

CS504 – Software Engineering - I CS605 – Software Engineering - II CS611 – Software Quality Assurance CS615 – Software Project Management

Statistics (18 Courses)

DSTA630 – Data Science Research Methods STA000 – Basic Statistics Fundamentals STA100 – Foundations of Statistics STA301 – Statistics and Probability STA304 – Statistical Inference STA404 – Experimental Design STA406 – Sampling Techniques STA408 – Biostatistics and Epidemiology STA630 – Research Methods in Social Sciences STA631 – Advanced Statistical Methods STA632 – Multivariate Analysis STA641 – Non-Parametric Methods STA642 – Econometric Models STA730 – Advanced Research Methodology in Statistics STAT100 – Statistics Fundamentals STAT404 – Applied Statistical Modeling STAT408 – Statistical Computing STAT730 – Advanced Biostatistics

Education (44 Courses)

ECE101 – Introduction to Early Childhood Care & Education EDU101 – Foundations of Education EDU201 – Learning Theories & Applications EDU205 – Classroom Management EDU301 – General Methods of Teaching EDU302 – Human Development & Learning EDU303 – School, Community and Teacher EDU304 – Educational Assessment & Evaluation EDU305 – Curriculum Development & Instruction EDU306 – Contemporary Trends in Education EDU401 – Critical Thinking and Reflective Practices EDU402 – Educational Leadership & Management EDU403 – Art, Craft & Calligraphy in Education EDU404 – Teaching of English EDU405 – Teaching of Mathematics EDU406 – Teaching of General Science EDU410 – ICT in Education EDU411 – Teaching of Social Studies EDU430 – Information & Communication Technology in Teaching EDU431 – Test Development & Measurement EDU433 – Educational Statistics EDU501 – Educational Psychology EDU505 – Guidance and Counseling in Schools EDU510 – Qualitative Research in Education EDU512 – Comparative Education EDU514 – Special Education Principles EDU515 – Early Childhood Education Curriculum EDU516 – Educational Technology & Media EDU601 – Philosophy of Education EDU602 – Educational Planning and Policy EDU604 – Educational Administration & Supervision EDU630 – Research Methods in Education EDU654 – Teacher Education in Pakistan EDU702 – Advanced Seminar in Educational Leadership EDU705 – Advanced Educational Policy Analysis EDUA305 – Applied Curriculum Development EDUA403 – Elementary Arts Education EDUA405 – Pedagogy of Mathematics EDUA516 – Educational Media Design EDUA630 – Action Research in Educational Settings MEDU402 – Master Level Educational Leadership MEDU406 – Science Teaching Pedagogies MEDU430 – Advanced ICT in Education MEDU601 – Advanced Philosophy of Education

Economics (11 Courses)

ECO401 – Economics (Micro & Macro) ECO402 – Microeconomics Analysis ECO403 – Macroeconomics Analysis ECO404 – Managerial Economics ECO406 – Development Economics ECO501 – Monetary Economics ECO601 – International Economics ECO603 – Public Sector Economics ECO606 – Agricultural Economics ECO607 – Environmental & Resource Economics ECO610 – Econometrics Principles

Management Sciences (26 Courses)

EMG525 – Engineering Project Management MGMT614 – Leadership & Team Building MGMT615 – Project Management Practices MGMT617 – Project Management Methodologies MGMT622 – Operations Management MGMT623 – Supply Chain Management MGMT625 – Knowledge Management Systems MGMT627 – Global Business Strategy MGMT628 – Strategic Management MGMT630 – Business Strategy & Policy MGMT631 – Innovation Management MGT101 – Financial Accounting MGT111 – Introduction to Public Administration MGT211 – Introduction to Business MGT301 – Principles of Marketing MGT402 – Cost & Management Accounting MGT411 – Money & Banking MGT501 – Human Resource Management MGT502 – Organizational Behaviour MGT503 – Principles of Management MGT510 – Total Quality Management MGT602 – Entrepreneurship MGT604 – Management of Financial Institutions MGT610 – Business Ethics & Corporate Governance MGT611 – Business & Labor Law MGTE630 – Business Management Strategy

English (34 Courses)

ENG001 – Basic English Grammar & Composition ENG101 – English Comprehension ENG201 – Business and Technical English Writing ENG301 – Business Communication ENG501 – History of English Language ENG502 – Introduction to Linguistics ENG503 – English Morphology and Syntax ENG504 – Sociolinguistics ENG505 – Phonetics & Phonology ENG506 – World Englishes ENG507 – Psycholinguistics ENG508 – Semantics & Pragmatics ENG509 – English for Specific Purposes (ESP) ENG510 – Language Testing & Evaluation ENG511 – Syllabus Design & Materials Development ENG512 – Stylistics & Literary Analysis ENG513 – Second Language Acquisition (SLA) ENG514 – Classical Poetry ENG515 – Classical Drama ENG516 – Research Methodology in Linguistics ENG517 – Modern Poetry ENG518 – Modern Drama ENG519 – Classical Novel ENG520 – Modern Novel ENG521 – American Literature ENG522 – Postcolonial Literature ENG523 – Continental Literature & Criticism ENG524 – Literary Criticism & Theory ENG525 – Discourse Analysis ENG526 – Applied Linguistics in Education ENG527 – Creative Writing & Composition ENG528 – Corpus Linguistics ENG529 – Translation Studies & Theory FENG301 – Functional English for Professionals

Islamic Studies (4 Courses)

ETH100 – Ethics (For Non-Muslim Students) ETH201 – Ethics & Moral Philosophy (For Non-Muslims) ISL201 – Islamic Studies ISL202 – Islamic Studies / Ethics

General Guides (1 Courses)

GENERAL – General University Resources, Guides & Handbooks

General Sciences (1 Courses)

GSC101 – General Science

Human Resources (4 Courses)

HRM613 – Human Resource Development HRM617 – Compensation & Benefits Management HRM624 – Conflict & Negotiation Management HRM627 – Strategic Human Resource Management

Information Technology (4 Courses)

IT430 – E-Commerce & Digital Business IT601 – Network Administration IT602 – Database Administration ITU430 – E-Commerce Systems

Microbiology (4 Courses)

MB501 – General Microbiology & Microbial Diversity MB502 – Microbial Physiology & Metabolism MB504 – Medical Microbiology MIC501 – Applied Microbiology

Mass Communication (22 Courses)

MCD401 – Media Content Development MCD403 – Media Ethics & Professional Standards MCM000 – Introduction to Communication Fundamentals MCM101 – Introduction to Mass Communication MCM301 – Communication Skills MCM304 – Mass Media in Pakistan MCM310 – Radio Broadcasting & Audio Media MCM311 – Radio & Television Production MCM401 – Fundamentals of Public Relations MCM404 – Electronic Media Content Creation MCM411 – News Writing and Reporting MCM431 – Digital Media & Online Journalism MCM501 – Development Support Communication MCM511 – Media Ethics, Cyber Laws & Regulation MCM514 – Feature, Column & Editorial Writing MCM517 – Advertising Strategy & Campaigns MCM520 – Print Media Design & Layout MCM531 – International & Cross-Cultural Communication MCM601 – Theories of Mass Communication MCM604 – Communication Research Methodology MCM610 – Cyber Journalism & Web Publishing MCMP310 – Radio & Audio Production Practical

Marketing (5 Courses)

MKT501 – Marketing Management MKT530 – Consumer Behaviour MKT610 – Customer Relationship Management (CRM) MKT621 – Advertising & Brand Management MKT630 – International Marketing Strategy

Mathematics (20 Courses)

MTH001 – Elementary Mathematics MTH100 – General Mathematics MTH101 – Calculus & Analytical Geometry MTH104 – Sets & Logic MTH202 – Discrete Mathematics MTH301 – Calculus II (Multivariable Calculus) MTH302 – Business Mathematics & Statistics MTH401 – Differential Equations MTH501 – Linear Algebra MTH601 – Operations Research MTH603 – Numerical Analysis MTH622 – Vector & Tensor Analysis MTH631 – Real Analysis MTH632 – Complex Analysis MTH634 – Topology MTH641 – Functional Analysis MTH644 – Mathematical Methods MTH645 – Mechanics MTH646 – Differential Geometry MTH647 – Fluid Mechanics

Social Studies (3 Courses)

PAK301 – Pakistan Studies PAK302 – History of Pakistan PAK522 – Ideology & Constitution of Pakistan

Physics (3 Courses)

PHY000 – Foundational Physics PHY101 – Physics - Mechanics & Waves PHY301 – Circuit Theory

Psychology (23 Courses)

PSY101 – General Psychology PSY401 – Clinical Psychology Fundamentals PSY402 – Social Psychology PSY403 – Developmental Psychology PSY404 – Abnormal Psychology PSY405 – Personality Theories & Assessment PSY406 – Educational Psychology Applications PSY407 – Experimental Psychology & Lab Methods PSY408 – Health Psychology PSY502 – History and Systems of Psychology PSY504 – Cognitive Psychology PSY505 – Psychological Testing & Measurement PSY510 – Positive Psychology & Well-being PSY511 – Counseling Psychology Principles PSY512 – Organizational & Industrial Psychology PSY513 – Neuropsychology Fundamentals PSY515 – Forensic & Criminal Psychology PSY516 – Cross-Cultural Psychology PSY610 – Neurological Basis of Behavior PSY611 – Psychopathology & Diagnostics PSY631 – Psychological Assessment Practicum PSY632 – Research Methods in Psychology PSYP631 – Psychological Assessment Lab Practical

Sociology (14 Courses)

SOC101 – Introduction to Sociology SOC201 – Pakistani Society and Culture SOC301 – Social Psychology & Society SOC302 – Cultural Anthropology SOC401 – Social Research Methods SOC402 – Classical Sociological Theories SOC403 – Social Change & Modernization SOC404 – Urban Sociology SOC601 – Rural Sociology & Community Development SOC602 – Gender Studies & Society SOC605 – Criminology & Juvenile Delinquency SOC608 – Sociology of Development SOC609 – Sociology of Health & Medicine SOC610 – Demography & Population Dynamics

Urdu Literature (2 Courses)

URD101 – Functional Urdu (Urdu Zaban-o-Adab) URDU101 – Urdu Language & Literature

Zoology (35 Courses)

ZOO101 – Principles of Animal Life I ZOO102 – Principles of Animal Life II ZOO103 – Animal Diversity: Invertebrates ZOO111 – Fundamentals of Zoology ZOO201 – Animal Diversity: Chordates ZOO202 – Animal Form & Function I ZOO203 – Animal Form & Function II ZOO301 – Animal Physiology ZOO302 – Cell & Molecular Biology in Zoology ZOO307 – Principles of Ecology ZOO401 – Evolution & Principles of Systematics ZOO403 – Animal Behavior & Sociobiology ZOO404 – Biostatistics for Zoologists ZOO405 – General Developmental Biology ZOO501 – Developmental Biology ZOO502 – Environmental Biology ZOO503 – Biostatistics in Zoological Research ZOO504 – Zoogeography & Paleontology ZOO505 – Wildlife of Pakistan & Conservation ZOO506 – Endocrinology ZOO507 – Animal Diversity & Behavior ZOO509 – Fish Biology & Fisheries Science ZOO510 – General Microbiology & Immunology ZOO511 – Immunology & Serology ZOO512 – Parasitology & Vectors ZOO513 – Applied Entomology ZOO514 – Biochemistry of Animals ZOO515 – Genetics & Population Biology ZOO516 – Aquaculture & Fisheries Management ZOO517 – Toxicology & Environmental Health ZOO518 – Comparative Vertebrate Anatomy ZOO519 – Mammalogy ZOO520 – Ornithology (Bird Biology) ZOO603 – Applied Parasitology & Vector Biology ZOO630 – Research Methodology in Zoology

Core Student Calculators & Rules Handbooks

Frequently Asked Questions – MIHORA VU Study Library

Where can I download VU Assignment Solution 2026 for CS101, CS201, MTH101, and all subjects?

MIHORA VU (https://study.mihora.tech/vu-assignment-solution-2026) offers verified 2026 assignment solutions, GDB answers, quiz files, and Dev-C++ code templates for all 455 Virtual University courses with 100% free direct downloads.

What is the 24-hour assignment grace period in Virtual University?

Virtual University gives students an automatic 24-hour grace period after the official assignment deadline. Submissions during this grace window are awarded full credit with 0 marks deduction.

How to avoid zero marks in VU assignments due to Turnitin plagiarism?

Never copy-paste solutions directly from YouTube or public groups. Keep Turnitin similarity under 19% by renaming code variables, rearranging logical statements, and writing custom explanations.

Where can I get Moaaz and Waqar Siddhu solved midterm and final past papers?

MIHORA VU hosts over 28,328 verified documents including complete Moaaz and Waqar Siddhu past paper collections for all 455 VU subjects, available via direct download without registration.

What is the 20% Two-Half passing rule in Virtual University?

Students must score at least 20% in the First Half (Quizzes, Assignments, GDBs, and Midterms) AND independently at least 20% in the Final Term exam paper to pass any course.