MIDTERM EXAMINATION
Spring 2009
CS201- Introduction to Programming
cs201 Question No: 1 ( M a r k s: 1 )
In C/C++ the #include is called,
►Header file
►Preprocessor Directive
►Statement
►Function
cs201 Question No: 2 ( M a r k s: 1 )
To access the element of two dimensional array we use,
►Single referencing
►Single dereferencing
►Double dereferencing
►Double referencing
cs201 Question No: 3 ( M a r k s: 1 )
Data Size of the file is always___________ the actual size of the file.
►Greater than
►Equal to
►Less than or equal to
►None of the above
cs201 Question No: 4 ( M a r k s: 1 )
When an identifier is declared with keyword const then,
►Its value can be changed during execution.
►Its value can not be changed
►Its value can be changed with arithmetic operator
►Its value can be overwritten
cs201 Question No: 5 ( M a r k s: 1 )
In C/C++ if we define an array of size eight (8) i.e. int Arr [8]; then the last element of this array will be stored at,
►Arr[0]
►Arr[8]
►Arr[7]
►Arr[-1]
cs201 Question No: 6 ( M a r k s: 1 )
If it is required to copy an array to another array then,
►Both arrays must be of the same size and data type
►Both arrays may be of different size
►Both arrays may be of different data type
►Both arrays may be of different size and type
cs201 Question No: 7 ( M a r k s: 1 )
In C/C++ all character strings are terminated with,
► Null character
► String
► Zero
► Full stop
cs201 Question No: 8 ( M a r k s: 1 )
Let suppose
struct intorDouble {
int ival; Double charvar;
};
main(){
intorDouble VAZ;
int size ;
size = sizeof(VAZ);
}
What will be the value of variable size, if int occupies 4 bytes and double occupies 8 bytes?
► 2
► 4
► 8
► 12
cs201 Question No: 9 ( M a r k s: 1 )
When a pointer is incremented, it actually jumps the number of memoryaddresses ►According to data type
►1 byte exactly
►1 bit exactly
►A pointer variable can not be incremented
cs201 Question No: 10 ( M a r k s: 1 )
Do-while loop executes at least,
►Zero Time
►One Time
►Two Times
►N Times
cs201 Question No: 11 ( M a r k s: 1 )
+= , *= , /= , etc are called,
►Assignment operators
►Logical operator
►Compound assignment operator
►Unary operator
cs201 Question No: 12 ( M a r k s: 1 )
Computer can understand only machine language code.
►True
►False
cs201 Question No: 13 ( M a r k s: 1 )
Which of the following is the correct syntax to print multiple values or variables in a single command using cout?
►cout <