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

VU Past Papers CS201-Midterm Most Important Revision Questions

CS201 – Introduction to Programming (MIDTERM) – Important Questions with Answers


Q#1: A precise sequence of steps to solve a problem is called
Answer: Program


Q#2: The Compiler of C language is written in
Answer: C Language


Q#3: Initialization of variable at the time of definition is
Answer: Good Programming


Q#4: In if structure the block of statements is executed only
Answer: When the condition is true


Q#5: Which of the following functions are included in stdlib.h?
Answer: **double atof(const char nptr) and int atoi(const char nptr)


Q#7: Pointer is a variable which stores
Answer: Memory Address


Q#8: Preprocessor program performs its function before ______ phase
Answer: Compiling


Q#9: Which of the following cannot be a variable name?
Answer: 10area


Q#10: Which looping process is best when the number of iterations is known?
Answer: for


Q#11: Which character is inserted at the end of string to indicate the end of string?
Answer: null character (\0)


Q#12: How many bytes are occupied by char str[] = "programming";
Answer: 12 → 11 characters + 1 null terminator


Q#13: Header file for rand() or other standard library functions
Answer: stdlib.h


Q#14: Commenting the code
Answer: Makes a program easy to understand for others


Q#15: What’s wrong with for(int k = 2, k <=12, k++)?
Answer: commas should be semicolons


Q#16: For which array, size should be one more than number of elements?
Answer: char → for null-terminated strings


Q#17: Category of software “Compiler and Interpreter”
Answer: System Software


Q#18: Result of expression x = 2 + 3 * 4 - 4 / 2
Answer: 12


Q#1 (2009 MCQ): In C/C++ the string constant is enclosed
Answer: Double quotes


Q#2 (2009 MCQ): Size of int
Answer: 2 bytes (may vary by system, often 4 bytes in modern compilers)


Q#3: Process in Flowchart
Answer: Rectangle


Q#4: If the break statement is missed in switch
Answer: This may cause a logical error


Q#5: Using const keyword, initialize at declaration
Answer: Must


Q#6: Assign integer 5 to matrix element m at second row, third column
Answer: m[1][2] = 5;


Q#7: Total elements in 3×2 array
Answer: 6


Q#8: const int *ptr
Answer: ptr is pointer to const int


Q#9: Pointer arithmetic ptr2 - ptr1
Answer: 3


Q#10: Assign array arr to pointer ptr
Answer: ptr = arr;


Q#11: C is a/an
Answer: Function-oriented language


Q#12: Executable file extension
Answer: .exe


Q#13: Variables having a name, type, and size are just like empty boxes
Answer: True


Q#14: For loop issue for(int k=2,k<=12,k++)
Answer: commas should be semicolons


Q#15: Efficient method for structure variables
Answer: True


Q#16: Syntax of union is identical to
Answer: Structure


Q#17: x = 27/4
Answer: 6 (integer division)


Q#18: General syntax of structure:

struct StructName {
    dataType member1;
    dataType member2;
    ...
};

Q#19: Assign value to structure member cust1.salary
Answer: cust1.salary = 2000;


Q#20: What is a compiler?
Answer: Program that translates high-level code to machine code


Q#21: Difference between while and for loop:

  • While: Number of iterations unknown, condition checked first
  • For: Number of iterations known, initialization/condition/increment in one line

 

Contents Copyrights Reserved By T4Tutorials