We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

www.vustudents.ning.com

 www.bit.ly/vucodes + Link For Assignments, GDBs & Online Quizzes Solution www.bit.ly/papersvu + Link For Past Papers, Solved MCQs, Short Notes & More

Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

# CS201 Online Quiz No 02 Discussion and Solution Due Date: 28th May 2014 to 29th May 2014

 Quiz No. 2 Dated: May 19, 14 Dear Students,Quiz No. 2 of CS201 will be started from Wedneday, May 28, 2014 and ends at Thursday, May 29, 2014.   Quiz No. 2 will cover 13-17 lectures.  There will be 10 questions in the quiz.

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?

Views: 9197

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

### Replies to This Discussion

CS201 Quiz No 2 | Date : May 29, 2014 : Time: 12:00 PM

1. n_________, we try to have a precise problem statement

Analysis
Design
Coding
None of the given

2. A character is stored in the memory in _________
byte
integer
string
none

3. What will be the correct syntax of declaration of the following statement? " ptr is a pointer to const int "

int const* ptr
int * const ptr
const int *ptr
const* int ptr

4. Transpose of a matrix means that when we interchange rows and columns_____________

the first row becomes the Last column
the first row becomes the first column
the Last row becomes the first column
the first column becomes the first row

5. Whenever some number is added in an array name, it will jump as many _____________as the added number.

rows
value
column
None of the given

6. The parameter passed to isdigit() function is ____________variable.

Character
Boolean
Integer
Float

7. The increment of a pointer depends on its

variable
value
data type
none

8. suppose we have int y[10]; To access the 4th element of the array we write_________

y[4];
y[3];
y[2];
none of given

9. How many bytes an integer type pointer intPtr will jump in memory if the statement below is executed? intPtr += 2 ;

3
4
8
12

10. 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.

double dereference
Single dereference
Dereference
None of the given

1. Analysis

2. byte

3. const int *ptr

4. the first row becomes the first column

5. rows

6.

7. data type

y[3];

9.

10. double dereference

6. Integer

9. 8 bytes

CS201 Quiz No 2 | Date : May 29, 2014 : Time: 12:30 PM

Q1. At the___________, we try to break up the problem into functional units

analysis phase
design phase
Implementation phase
None of the given

Q2. The increment of a pointer depends on its___________.

variable
value
data type
none

Q3. We must include the header file ________to convert the value of one type into another type using built-in functions.

conio.h
stdlib.h.
string.h
iostream.h

Q4. We must include the header file ________to convert the value of one type into another type using built-in functions.

Q5. To get the value stored at a memory address, we use the_______________

referencing operator
dereferencing operator
simple operator
None of the given

Q6. A character is stored in the memory in _________

byte
integer
string
none

Q7. char **argv can be read as_________________

pointer to pointer
pointer to char
pointer to pointer to char
None of the given

Q8. ______________ Returns true if c is a letter and false otherwise.

int isalpha( int c )
int isalnum( int c )
int isxdigit( int c )
int isdigit( int c )

Q9. suppose we have int y[10]; To access the 4th element of the array we write________

y[4];
y[3];
y[2];
none

Q10. Given a two dimensional array of integers, what would be the correct way of assigning the value 6 to the element at third row and fourth column?

array[3][4] = 6 ;
array[2][4] = 6 ;
array[4][3] = 6 ;
array[2][3] = 6 ;

1. design phase

2. data type

3.

4.

5. dereferencing operator

6. byte

7. pointer to pointer(Not sure)

8. int isalpha( int c )

9. y[3];

10. array[2][3] = 6 ;

# CS201 Introduction To Programming Solved MCQs from Quiz 2

Functions declared with the _______________ specifier in a class member list are called friend functions of that class.
protected
private
public
friend

Functions declared with the friend specifier in a class member list are called friend functions of that class. Classes declared with the friend specifier in the member list of another class are called friend classes of that class.

Public or private keywords can be ____________

written only for once in the class or structure declaration
written multiple times in the class or structure declaration

written only twice in the class declaration
written outside the class

good practice is to write public or private keywords only once in the class or structure declaration, though there is no syntactical or logical problem in writing them multiple times.

The friend keyword provides access _____________.
in one direction only
in two directions
to all classes
to the data members of the friend class only

The friend keyword provides access in one direction only. This means that while OtherClass is a friend of ClassOne, the reverse is not true.

References cannot be uninitialized. Because it is impossible to _______________

reinitialize a pointer
reinitialize a reference
initialize a NULL pointer
cast a pointer

References cannot be uninitialized. Because it is impossible to reinitialize a reference,

new operator can be used for ______________.
only integer data type
only char and integer data types
integer , float, char and double data types
dot operator
Similarly, new operator can be used for other data types like char, float and double etc.

The destructor is used to ______________.

allocate memory
deallocate memory
create objects
allocate static memory

Reference is not really an address it is ______________.

a synonym
an antonym
a value
a number
Difference Between References and Pointers
The reference in a way keeps the address of the data entity. But it is not really an address it is a synonym,

If we want to allocate memory to an array of 5 integers dynamically, the syntax will be _____________.

int *iptr ; iptr = new int[5] ;

integer iptr** ; iptr= new int[5]

int iptr ; iptr= int [5]

iptr= new[5]

Memory allocated from heap or free store _____________________.

can be returned back to the system automatically

can be allocated to classes only

cannot be returned back unless freed explicitly using malloc and realloc

cannot be returned back unless freed explicitly using free and delete operators

The memory allocated from free store or heap is a system resource and is not returned back to the system unless explicitly freed using deleteor free operators.

Operator overloading is to allow the same operator to be bound to more than one implementation, depending on the types of the _________.

Compilers
Operands
Function names
Applications

Operator overloading is to allow the same operator to be bound to more than one implementation, depending on the types of the operands.

The operator to free the allocated memory using new operator is ________________.

free
del
delete
remove

1. To read command-line arguments, the main() function itself must be given ___________ arguments
a. 1 b. 2 ANS c. 3 d. 4

2____________________ Returns true if c is a digit or a letter and false otherwise.
a. int isalnum( int c ) ANS
b. int isalpha( int c )
c. int isxdigit( int c )

3.The increment of a pointer depends on its___________.
a. data type ANS
b. value
c. variable

4. dereferencing operator is represented by _______
a. +
b. * ANS
c. &

5. There is a pointer variable named ptr of type float then address of which type of variable the ptr will store in it?
a. int
b. float. ANS
c. double.

6. suppose we have int y[10]; To access the 4th element of the array we write_________
a. y[4]
b. y[3] ANS
c. y(4)

7.Given a two dimensional array of integers, what would be the correct way of assigning the value 6 to the element at third row and fourth column?
a. array[2][4] = 6 ;
b. array[3][4] = 6 ;
c. array[2][3] = 6 ; ANS

8.. At the___________, we try to break up the problem into functional units
1 design phase ANS
2 Implementation phase
3 analysis phase
4 None of the given

CS201_Online_Quiz_2

Attachments:

Q1-_______________are conventional names of the command line parameters of the ‘main()’ function.

Continued after the jump ....

‘argb’ and ‘argv’

‘argc’ and ‘argv’

‘argc’ and ‘argu’

Q2-Suppose that an integer type pointer contains a memory address 0x22f220. What will be the new memory address if we increment this pointer by one?

0x22f221

0x22f222

0x22f223

0x22f224

Q3-Which header file must be included to use the functions tolower() and toupper()?

iostream.h

conio.h

ctype.h

stdlib.h

Q4-dereferencing operator is represented by

*

+

-

none

Q5-In Analysis, we try to have a______________

Determined the inputs

Break up of problem (I think not sure)

Precise problem statement

None of the given

Q6Base address is the memory address of _______ element of an array.

1st

2nd

3rd

4th

Q7-Pointers store the

value of a variable

characters

none

Q8-The name of the array is a constant pointer which contains the memory address of the ____________of the array.

first element

Last element

second element

none

Q9-Whenever some number is added in an array name, it will jump as many _____________as the added number.

rows

value

col

none

Q10- ___________ Returns true if c is a digit and false otherwise

int isalpha( int c )

int isalnum( int c )

int isxdigit( int c )

int isdigit( int c )

2nd quiz 29-May-14

Attachments:

## Latest Activity

♦_"Tooba"_♦ liked Destruido's discussion arrange the spellings
46 minutes ago
47 minutes ago
♦_"Tooba"_♦ liked Destruido's discussion Find the name of fruits
48 minutes ago
48 minutes ago
♦_"Tooba"_♦ replied to 彡ＪＫ彡❤️'s discussion Positive language
49 minutes ago
♦_"Tooba"_♦ replied to 彡ＪＫ彡❤️'s discussion عید الفطر 2020
50 minutes ago
♦_"Tooba"_♦ liked 彡ＪＫ彡❤️'s discussion عید الفطر 2020
50 minutes ago
♦_"Tooba"_♦ liked Maham Raza.'s discussion Kabhi Aesa Bhi Hota Hai.
59 minutes ago
Maham Raza. posted discussions
1 hour ago
♦_"Tooba"_♦ liked 彡ＪＫ彡❤️'s discussion Positive language
1 hour ago
♦_"Tooba"_♦ liked Destruido's discussion Find the name of fruits
1 hour ago
♦_"Tooba"_♦ liked Destruido's discussion Find the name of fruits
1 hour ago

1

2

3