Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
(1-MARK questions)
1
d. 0
11. Switch () is a
a. Iterative statement
b. Decision statement
c. Control statement
d. None of the above
20. What math method, invoked this Math.method(x);would return the value –5 given the
value of x to be –4.5
a. round()
b. ceil()
c. floor()
d. a and c
3
b. class, struct
c. a and b
d. none of the above
30. iostream.h header file has to be included for the file input and output. False
31. Pointers are variables that stores address values of other variables. True
4
32. Unary operators overloaded for the class can differentiate between post and pre
operators. False
33. Static data member of a class can be modified by all objects of the class.
True
36. If the function does not have any return value, the return statement can be skipped.
True
38. In array every data should be separated by comma and all elements enclosed within
flower bracket while initializing during declaration. True
39. The static variables of the class have to be explicitly initialized outside the class
name followed by scope resolution operator (: : ) and static variable name True
(2-MARKS questions)
41. The ________ is used to access the public members of the class with a ________ of
an object (→{arrow}, Pointer)
42. The operator ______ When placed before a variable, returns the memory address of
its operand and the ____________ returns the data value stored in the area being
pointed to by the pointer following it (&, *)
43. When amount of memory is predicated and the memory is allocated during compile-
time (When the program is being compiled, it is referred to as _______ But when
amount of memory to be allocated is not prebnown, and the memory is allocated
during runtime (when the program is running as when required, it is referred to as)
_________ (Static memory allocation, dynamic memory allocation)
44. The process of –invoking a function through its own body is known ______
(Recession)
45. The variables or values passed to a function are called __________ or ______ (Actual
parameters, arguments)
5
46. There are two default variables ___________of type int and _________ predefined
for storing command line arguments which are usually defined as arguments to the
main functions. (argc, argv(array of strings)).
48. cin is a predefined object of __________ class, while cout is a predefined object of
__________ class.(fstream.h, ostream_withassign).
49. The class istream is derived from _________ class which contains all the necessary
___________for handling input. (ios, functions).
51. C++ programs goes through two phases _________ and ________ before execution.
(Compiling, linking).
53. ________ is the extension of C++ program source files and _________ is the
extension of C++ object code.(.cpp, .obj)
54. _________ is the loop variable in the loop (for(int k=0;k<n;k++) and will be
executed till the statement ____ becomes false. (k, k<n)
55. _____________ header file should be included to use exit function.. The syntax of
this function is _________(process.h, exit(integer)).
56. External variables are also known as _____________ and automatically initialized tlo
_____________. (global, zero)
58. The loop (for (j=0;j<100;j=j+2) will be executed how many times
a) 100 b) 50 c) 51 d)49
Int ch =20;
Cout <<ch <<++ch<<ch,
We touch the future ☺ we teach !
Ans a. 21 21 20
b. 20 20 21
c. 20 21 20
6
d. 21 20 21
Hint Because when multiple values are cascaded without, calculations tabe place from
right-to-left but printing tabe place from left-to-right.
60. Name the header file to be included for the use of following built-in- functions:
a. Isupperc
b. Gets
c. Strlen
d. Log ()
(4-MARKS questions)
1. Single inheritance
2. multiple inheritance
3. Hierarchical inheritance
4. Multilevel inheritance
5. Hybrid inheritance
a) ALL
b) Only 1 ,2 and 3
c) Only 1, 3 and 5
d) Only 1, 3 and 4
63. i. The memory space for global variables is reserved prior to program execution
ii. The memory space for local variables is allocated on the fly during program
execution.
7
64. Function overloading is appropriate for:
i) Definition functions which essentially do the same thing , but operate on
different data types.
ii) providing alternate interfaces to the same function.
a. Only i is true
b. Only ii is true
c. Both are true
d. Both are false
65. i) this pointers are not accessible for static member functions.
ii) this pointer are not modifiable.
a. only i is true
b. only ii is true
c. both a and b
d. none of the above
67. A file can be opened in C++ by i)Using the constructor of the stream class
ii)Using the open() function of the stream
a. Only i) is true
b. Only ii) is true
c. Both are true
d. None is true
a. 500
b. 100
c. 200 We touch the future ☺ we teach !
d. none of the above
8
int s1,s2,num;
s1=s2=0;
for(x=0;x<11;x++)
{
cin<<num;
if(num>0)s1+=num;else s2=/num;
}
cout<<s1<<s2;
}
a. runtime error
b. compilation error
c. 1,1
a. 0,1
9
a) INDIA
b) Bharat
c)
I
IN
IND
INDI
INDIA
d) none of the above
72. What storage class would you use for the following situations?
10
per P(‘\0’,0);
P=P1.GR(P3);P.display();
P=P2.GR(P3);P.display();
}
a) nameKALU
age40
nameRAJU
age53
b) nameRAMU
age27.5
nameRAJU
age53
c) nameRAMU
age27.5
nameKALU
age40
d) none of the above
a. two
b. two three invalid
c. erro r
d. invalid
11
a. 13 13
b. 13 12
c. 12 13
d. 12 12
a. no display
b. error
c. Churchgate:no church no gate
d. Churchgate
12
}
void main()
{
myclass ab;
ab.show();
getch();
}
a) In contructor 10
b) 10 destructor
c) In constructor 10 Destructor
d) None of the above
78. What will be the output of the following:
#include<iostream.h>
class integer
{
int m,n;
public:
integer(int , int);
void display(void)
{
cout<<”m=”<<m<<”\n”;
cout<<”n=”<<n<<”\n”;
}
};
integer::integer(int x, int y)
{
m=x;
n=y;
}
main()
{
integer int1(0,100);
integer int2=integer(25,75);
cout<<”\n Object1”<<”\n”;
int1.display();
cout<<”\n OBJECT2”<<”\n”;
int2.display();
}
a) Object1
m=0
n=10
b) OBJECT2
m=25
n=75
13
c) Object1
m=25
n=75
d) None of the above
14