MIDTERM EXAMINATION |
Spring 2009 |
CS201- Introduction to Programming (Session - 1) |
Question No: 1 ( Marks: 1 ) - Please choose one |
In C/C++ the #include is called, |
Header file |
Preprocessor Directive |
Statement |
Function |
Question No: 2 ( Marks: 1 ) - Please choose one |
To access the element of two dimensional array we use, |
Single referencing |
Single dereferencing |
Double dereferencing |
Double referencing |
Question No: 3 ( Marks: 1 ) - Please choose one |
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 |
Question No: 4 ( Marks: 1 ) - Please choose one |
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 |
Question No: 5 ( Marks: 1 ) - Please choose one |
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] |
Question No: 6 ( Marks: 1 ) - Please choose one |
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 |
Question No: 7 ( Marks: 1 ) - Please choose one |
In C/C++ all character strings are terminated with, |
Null character |
String |
Zero |
Full stop |
Question No: 8 ( Marks: 1 ) - Please choose one |
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 |
Question No: 9 ( Marks: 1 ) - Please choose one |
When a pointer is incremented, it actually jumps the number of memory |
addresses |
According to data type |
1 byte exactly |
1 bit exactly |
A pointer variable can not be incremented |
Question No: 10 ( Marks: 1 ) - Please choose one |
Do-while loop executes at least, |
Zero Time |
One Time |
Two Times |
N Times |
Question No: 11 ( Marks: 1 ) - Please choose one |
+= , *= , /= , etc are called, |
Assignment operators |
Logical operator |
Compound assignment operator |
Unary operator |
Question No: 12 ( Marks: 1 ) - Please choose one |
Computer can understand only machine language code. |
True |
False |
Question No: 13 ( Marks: 1 ) - Please choose one |
Which of the following is the correct syntax to print multiple values or variables in |
a single command using cout? |
cout << "Hello" + x + "\n"; |
cout << "H" << x << "\n"; |
cout << "H", x, "\n"; |
cout << ("H" & x & "\n"); |
Question No: 14 ( Marks: 1 ) - Please choose one |
The compilers and interpreters also belong to the System Software category. |
True |
False |
Question No: 15 ( Marks: 1 ) - Please choose one |
Editors are used to compile the code. |
True |
False |
Question No: 16 ( Marks: 1 ) - Please choose one |
The variables having a name, type and size are just like empty boxes. |
True |
False |
Question No: 17 ( Marks: 1 ) |
For Exclusive Projects, Reports & Latest Papers |
What will be the result of the statement? |
rand ( ) % 50 |
Question No: 18 ( Marks: 1 ) |
What is the ASCII code of null character and how is it represented? |
Question No: 19 ( Marks: 2 ) |
What is a truth Table? |
Question No: 20 ( Marks: 3 ) |
How learning to design programs is like learning to play soccer? |
Question No: 21 ( Marks: 5 ) |
What is the purpose of the default statement in the switch statement? |
Question No: 22 ( Marks: 10 ) |
Write a program which contains a user defined function named |
ConvertInSeconds |
that |
takes 3 integer arguments hours, minutes and seconds, this function converts the time into |
seconds and returns the number of seconds. |
Input variables hours , minutes and seconds in main program and call the function |
ConvertInSeconds |
and display the number of seconds returned by function. |
Hint: |
1 hour =60 minutes |