0% found this document useful (0 votes)
5 views

CS201 Midterm Solved Quizs 1 2015

NILL

Uploaded by

mc200405451
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

CS201 Midterm Solved Quizs 1 2015

NILL

Uploaded by

mc200405451
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

CS201 Solved Quiz No-1 December 13, 2015

1. We use _________ to open a file or stream for extraction


in
2. Null character is represented by _________ in C++.
/0
3. An object of _________ class can be created for saving the
current position of any opened file before reading from the
file.
Streampos
pg215
4. ____________________ Returns true if c is a digit or a
letter and false otherwise.
int isalnum( int c )

5. We use _________ to open a file or stream for insertion.


out
6. Base address is the memory address of _______ element of
an array.
1st
7. __________ allow us to have a memory location and use it
as int or char interchangeably
union
8. To read command-line arguments, the main() function itself
must be given ___________ arguments.
2
9. Individual characters in a string stored in an array can be
accessed directly using array _______.
subscript
10. To manipulate n-dimensional array ___________
nested loops are required.
n-1

=========================================
Inno latest CS201 Solved Quizz No-1 Fall2015

1. A character is stored in the memory in _________


string
2. What will be the size of following array?
int arr[29];
29
3. An object of _________ class can be created for saving the
current position of any opened file before reading from the
file.
Streampos
pg215
4. We use _________ to open a file or stream for extraction.
in
5. We use _________ to open a file or stream for insertion.
out
6. _______________are conventional names of the command
line parameters of the ‘main()’ function.
‘argc’ and ‘argv’
7. In_____________, we have different data members and all
of these have their own memory space.
structures
8. How we declare an array of integer data whose size is 20
with array name “count”.
int count[20];
9. A ________is an array of characters that can store number
of character specified.
String
File. seekg (-10L, ios:cur)
backword direction

CS201 FIRST QUIZ 2015


A function is a block of statements that can be defined once and used
________ in the program.
One time
Two times
Three times

As many times as user wants

What will be the output of the following while loop? int counter = 0 ;
while(counter < 15) cout << counter << “ ”; counter++;

1234
12345
Compile time error
Infinite loop

We can access a global variable ___________


From the functions only
From the loops only
From the main() function only
From anywhere in the program

A repetition statement specifies that an action is to be continued while


some_______ remains true.
Condition
Control
Asignment
Operator

Loops are _______________ Structure.


Decision
Sequential
Repetition
None of the given options

_________ operator is used to pass the address of a variable in call by


reference method.
%
+
@
&
How many times the following do-while loop will execute? int k = 10; do
{ cout << "Statements" << endl; k -= 2; } while(k>0);
4
5
6
7
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; }
mango
mango any fruit
Apple
none of the above

By default, the starting index of an array in C++ is _______.


2
-1
0
1
A variable declared within a code block becomes ________ variable for
that block
Static
Integer
Local
Global

You might also like