Pages: [1]   Go Down
  Send this topic  |  Print  
Author
[EN] [PL] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU]
Topic: MCQ's of CS201, Introduction to programming, mcq's cs201 mid final term exams  (Read 1758 times)
0 Members and 2 Guests are viewing this topic.
admin
Administrator
Hero Member
*****

Ranking: 200
Offline Offline

Posts: 16074


Looking for some members that can help other students in Studies


« on: May 21, 2011, 09:16:34 AM »

MCQ's of CS201, Introduction to programming, mcq's cs201 mid final term exams
The size of int data type is
?
1 bytes
?
2 bytes
?
3 bytes
?
4 bytes
   In Flow chart process is represented by
?
Rectangle
 
?
Arrow symbol
?
Oval
?
Circle  If the break statement is missed in switch statement then,
?
The compiler will give error
?
This may cause a logical error
?
No effect on program
?
Program stops its execution  When we are using const keyword with a variable x then initializing it at the time of declaration is,
?
 
Must
 
?
Optional
?
Not necessary
?
A syntax error   Which of the following is the correct way to assign an integer value 5 to element of amatrix say ‘m’ at second row and third column?
?
m[2][3] = 5 ;
 
?
m[3][2] = 5 ;
?
m[1][2] = 5 ;
?
m[2][3] = ‘5’;  How many total elements must be in two-dimensional array of 3 rows and 2 columns?
?
4
?
5
?
6
 
?
7   
vu.ysapak.com
For more just visit vu.ysapak.com


 
 
30
 
 Which of the following is the correct statement for the following declaration? const int *ptr.
?
ptr is a constant pointer ptr is constant integer pointer
 
?
 
 
 
?
 
ptr is a constant pointer to intptr is a pointer to const int
 
?
 
   Consider the following code segment. What will be the output of this code segment?int arr[6] = {2, 3, 7, 4, 5, 6} ;int *ptr1 =&arr[1] ;int *ptr2 = &arr[4] ;cout << (ptr2-ptr1) ;
?
3
?
9
?
12
?
2
   What will be the correct syntax to assign an array named arr of 5 elements to a pointer ptr?
?
*ptr = arr ;ptr = arr ;
 
?
 
 
?
 
*ptr = arr[5]
 
 
;ptr = arr[5] ;
 
?
 
   The variables having a name, type and size are just like empty boxes.
?
False
 
 True
 
?
 
   What's wrong with this for loop?for (int k = 2, k <=12, k++)
?
the increment should always be ++k
?
the variable must always be the letter i when using a for loop
?
there should be a semicolon at the end of the statement
?
the commas should be semicolons       
vu.ysapak.comFor more just visit vu.ysapak.com

 
 
31
 
Most efficient method of dealing with structure variables is to define the structureglobally
?
TrueFalse
 
?
 
   Syntax of union is identical to ______
?
 
Structure
 
?
Class
?
Function
?
None of the given options  Like member functions, ______ can also access the private data members of a class.Non-member functions
?
 
Friend functionsAny function outside class
N
one of the given options   Function created with in function called? nestedoverloadedgroupednone of them
 
vu.ysapak.com
Logged
admin
Administrator
Hero Member
*****

Ranking: 200
Offline Offline

Posts: 16074


Looking for some members that can help other students in Studies


« Reply #1 on: May 21, 2011, 09:18:50 AM »




 
CS201 Latest Solved MCQs
 
13
 
 
?
 
The new operator determines the size of an object
 
?
 
Allocates memory to object and returns pointer of valid type
 
?
 
Creates an object and calls the constructor to initialize the object
 
?
All of the given options
 
Question No: 20      ( Marks: 1 ) - Please choose one
new and delete are _____ whereas malloc and free are _____.
 
?
 
Functions, operators
 
?
 
Classes, operators
 
?
 
Operators, functions
 
?
 
Operators, classes
 Question No: 21      ( Marks: 1 ) - Please choose one
 Like member functions, ______ can also access the private data members of a class.
 
?
 
Non-member functions
 
?
 
Friend functions
 
?
 
Any function outside class
 
?
 
None of the given options
 Question No: 22      ( Marks: 1 ) - Please choose one
 Which of the following statement is best regarding declaration of friend function?
 
?
 
Friend function must be declared after public keyword.
 
?
 
Friend function must be declared after private keyword.
 
?
 
Friend function must be declared at the top within class definition.
 
?
 
It can be declared anywhere in class as these are not affected by the public andprivate keywords.
 Question No: 23      ( Marks: 1 ) - Please choose one
The operator function overloaded for an Assignment operator (=) must be
 
?
 
Non-member function of class
 
?
Member function of class
?
 
Friend function of class
 
?
 
None of the given options
 Question No: 24      ( Marks: 1 ) - Please choose one
For non-member operator function, object on left side of the operator may be
 
?
 
Object of operator class
 
?
 
Object of different class
 
?
 
Built-in data type
 
?
 
All of the given options
for more just visit vu.ysapak.com
 
 
CS201 Latest Solved MCQs
 
14
 
 Question No: 25      ( Marks: 1 ) - Please choose one
The operator function will be implemented as _____, if obj1 drive the - operator whereasobj2 is passed as arguments to - operator in the statement given below.
obj3   =   obj1 -   obj2; 
?
 
Member function
 
?
 
Non-member function
 
?
Friend function
?
 
None of the given options
 Question No: 26      ( Marks: 1 ) - Please choose one
Which one of the following is the declaration of overloaded pre-increment operator implemented as member function?
 
?
 
Class-name operator +() ;
 
?
 
Class-name operator +(int) ;
 
?
 
Class-name operator ++() ;
 
?
 
Class-name operator ++(int) ;
 Question No: 27      ( Marks: 1 ) - Please choose one
 The static data members of a class are initialized _______
 
?
 
at file scope
 
?
within class definition
?
 
within member function
 
?
 
within main function
 Question No: 28      ( Marks: 1 ) - Please choose one
 Class is a user defined___________.
 
?
 
data type
 
?
 
memory referee
 
?
 
value
 
?
 
none of the given options.
 Question No: 29      ( Marks: 1 ) - Please choose one
We can also define a user-defines manipulators.
 
?
True
?
 
False
   
for more just visit vu.ysapak.com
 
 

Logged
admin
Administrator
Hero Member
*****

Ranking: 200
Offline Offline

Posts: 16074


Looking for some members that can help other students in Studies


« Reply #2 on: May 21, 2011, 09:20:31 AM »



 
 
CS201 Latest Solved MCQs
 
25
 
Question No: 18      ( Marks: 1 ) - Please choose one
 Which one of the following is the declaration of overloaded pre-increment operator implemented as member function?
 
?
 
Class-name operator +() ;
 
?
 
Class-name operator +(int) ;
 
?
 
Class-name operator ++() ;
 
?
Class-name operator ++(int) ; Question No: 19      ( Marks: 1 ) - Please choose one
 For cin, the source is normally a ________ and destination can be ______.
 
?
 
File, native data type
 
?
 
Disk, user-define type
 
?
Keyboard, variable
?
 
File, user-define type
 Question No: 20      ( Marks: 1 ) - Please choose one
 We can also do conditional compilation with preprocessor directives.
 
?
True
?
 
False
 Question No: 21      ( Marks: 1 ) - Please choose one
 The programs, in which we allocate static memory, run essentially on ________
 
?
 
Heap
 
?
 
System Cache
 
?
 
None of the given options
 
?
Stack   Question No: 22      ( Marks: 1 ) - Please choose one
 The default value of a parameter can be provided inside the ________________
 
?
 
function prototype
 
?
function definition
?
 
both function prototype or function definition
 
?
 
none of the given options.
 
for more just visit vu.ysapak.com
 
 
CS201 Latest Solved MCQs
 
26
 
 Question No: 23      ( Marks: 1 ) - Please choose one
 
While calling function, the arguments are assigned to the parameters from _____________.
 
 
?
 
left to right.
 
?
 
right to left
 
 
?
 
no specific order is followed
 
?
 
none of the given options.
 
 Question No: 24      ( Marks: 1 ) - Please choose one
 When an operator function is defined as member function for a binary Plus (+) operator then the number of argument it take is/are.
 
?
 
Zero
 
?
 
One
 
?
 
Two
 
?
N arguments Question No: 25      ( Marks: 1 ) - Please choose one
 With user-defined data type variables (Objects), self assignment can produce__________.
 
?
 
Syntax error
 
?
Logical error
?
 
Link error
 
?
 
Non of the given options
Question No: 26      ( Marks: 1 ) - Please choose one
 Assignment operator is used to initialize a newly declared object from existing object.
   
?
True
?
 
False
 Question No: 27      ( Marks: 1 ) - Please choose one
 When an object of a class is defined inside an other class then,
 
?
Constructor of enclosing class will be called first
 
?
Constructor of inner object will be called first
?
 
Constructor and Destructor will be called simultaneously
 
?
 
None of the given options
for more just visit vu.ysapak.com
 
 
CS201 Latest Solved MCQs
 
27
 
 Question No: 28      ( Marks: 1 ) - Please choose one
 In the member initializer list, the data members are initialized,
 
?
 
From left to right
 
?
 
From right to left
 
?
In the order in which they are defined within class
?
 
None of the given options
 Question No: 29      ( Marks: 1 ) - Please choose one
 new operator allocates memory from free store and return _____________.
 
?
A pointer
?
 
A reference
 
?
 
An integer
 
?
 
A float
Question No: 30      ( Marks: 1 ) - Please choose one
 "new" and "delete" keywords are _____________ in C++ language.
 
?
 
Built-in- Function
 
?
 
Operators
 
 
?
Memory Allocation Function
?
 
None of  the given options
for more just visit vu.ysapak.com


Logged
Pages: [1]   Go Up
  Send this topic  |  Print  
 
Jump to:  

Get Daily Ayat & Ahadith. To subscribe simply write JOIN ysa1 in sms send it to 8002. for Quotation, Recipes, Joke, Words alerts click here


Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC | Page created in 0.131 seconds with 21 queries.