Você está na página 1de 8

1.

What is the output of the following code A - char B - int C - float


snippet? D - Double
#include<stdio.h>
main() 8. According to ANSI specification, how to
{ declare main () function with command-line
const int a = 5; arguments?
a++; A - int main(int argc, char *argv[])
printf("%d", a); B - int char main(int argc, *argv)
} C-
A - 5, B - 6, C - Runtime error, D - Compile int main()
error {
Int char (*argv argc);
2.What is the output of the following program? )
#include<stdio.h> D - None of the above
main()
{ 9.Which of the following is not a valid variable
int r, x = 2; name declaration?
float y = 5; a) int __a3;
b) int __3a;
r = y%x; c) int __A3;
printf("%d", r); d) None of the mentioned
}
A - 1, B - 0, C - 2, D - Compile error 10. Which of the following is true for variable
names in C?
3.What is the output of the following program? a) They can contain alphanumeric characters as
#include<stdio.h> well as special characters
main() b) It is not an error to declare a variable to be
{ one of the keywords(like goto, static)
union abc { c) Variable names cannot start with a digit
int x; d) Variable can be of any length
char ch;
}var; 11.What is the maximun number of dimensions
an array in C may have?
var.ch = 'A'; A. Two
printf("%d", var.x); B. Eight
} C. Twenty
A - A, B - Garbage value, C - 65, D - 97 D. Theoratically no limit. The only
practical limits are memory size and compilers
4.The return keyword used to transfer control
from a function back to the calling function. 12. Choose the correct statements
A - Yes, B - Switch, C - go back, D - goto A. All The elements of the array should be of the
same data type and storage class
5. Choose the correct order of evaluation, B. The number of subscripts determines the
A - Relational Arithmetic Logical Assignment, dimension of the array
B - Arithmetic Relational Logical Assignment C. The array elements need not be of the same
C - Logical Arithmetic Relational Assignment storage class
D - Assignment Arithmetic Logical Relational D. In an array definition. the subscript can be
any expression yielding a non-zero integer value

6. Which header file supports the functions - 13. A member function can always access
malloc() and calloc()? the data
A - stdlib.h B - memory.h A. In the object of which it is a member
C - math.h D - stdio.h B. In the class of which it is a member
C. In any object of the class of which it is a
7. Which of the following variable cannot be member
used by switch-case statement? D. In the public part of its class
D. parameterized
14. The dot operator/ class member access
operator connects the following two entities 21. How many private, public or protected
reading from left to right sections can be there in a class?
A. A class member and a class object A. One
B. A class object and class member B. Two
C. A class and class object C. Three
D. A class and member of that class D. Multiple

15. The scope resolution operator connects 22. The Members of a class can be
the following two entities reading from left to A. Data
right B. Member Functions
A. A class member and a class object C. Type Definitions
B. A class object and class member D. All of the above
C. A class and class object
D. A class and member of that class 23. With every use of a memory allocation
function, what function should be used to release
16. A class ABC has objects obj1, obj2, allocated memory which is no longer needed?
obj3. for the statement obj3=obj2-obj1 to work A. unalloc(), B. dropmem()
the overloaded operator ?-? must C. dealloc() D. free()
A. take two arguments
B. Return a value 24. int testarray[2][2][2] = {11, 22, 33, 44, 55,
C. Create a named temporary object 66, 77, 88}; What value does testarray[1][1][0]
D. Use the object of which it is a member in the sample code above contain?
as an operand A. 55 B. 77 C. 88
D. 11
17. To convert from a user defined class to a
basic type , which of these is necessary 25. int a=10,b; b=a++ + ++a;
A. Built in conversion printf("%d,%d,%d,%d",b,a++,a,++a); what will
B. A one argument constructor be the output when following code is executed
C. An overloaded = operator A. 12,10,11,13, B. 22,10,11,13
D. A conversion function that?s the C. 22,11,11,11 D.
member of the class 22,13,13,13

18. Member functions defined inside the 26. When reallocating memory if any other
class definition ,by default are called pointers point into same piece of memory do
A. Member Function these pointers-
B. Inline Function A. need to be readjusted B.
C. Constructor they get readjusted automatically
D. Parameterized function C. C does it on behalf of user D.
none of above
19. When arithmetic assignment operator is
overloaded , the result 27. What is the output of the following
A. Goes in the object to right of the program? void main() { int *ptr =55; clrscr();
operator printf("%d", ++(ptr)); }
B. Goes in the object to the left of the A. 54 B. 55 C. 56
operator D. some address
C. Goes in the object of which the operator
is a member 28. main() { int i, j, *p; i = 25; j = 100; p =
D. Must be returned &i; printf("%f", i/(*p) ); }
A. Compile erro
20. Which of these is not a valid constructor B. 1.00000
type- C. Runtime error.
A. inline D. 0.00000
B. copy
C. default
29. main() { int i, j; scanf("%d have to worry about respecting the class
%d"+scanf("%d %d", &i, &j)); printf("%d %d", interface
i, j); } B. They allow us to break the
A. Compile error encapsulation of other user-defined classes
B. 0, 0 whenever we want, thereby enabling us to
C. Runtime error. improve efficiency
D. the first two values entered by the user. C. They allow us to break encapsulation in
a controlled manner, which ensures that
30. In the following code, in which order efficiency does not compromise maintainability
the functions would be called? x = D. They prevent non-overloaded functions
f1(23,14)*f2(12/4)+f3(); from getting lonely
A. f1, f2, f3
B. f3, f2, f1 35. Apart from operator=, the operators
C. The order may vary from compiler to most commonly overloaded are operator<< and
compiler operator>>. Why?
D. None of the above A. Because left- and right-shifting is a very
common task in programs.
31. If a binary operator is overloaded as a B. Because they can be member functions
member function, how many parameters will the or global functions.
member function require? C. Because they make it easy to do I/O on
A. None. Both operands are passed via the user-defined classes.
object. D. Because in early versions of C++, they
B. One, to pass the second operand. The were the only operators which could be
first operand is the object itself. overloaded.
C. Two, to pass the first and second
operands. 36. A friend of a class is also automatically
D. Binary operators can't be overloaded at a friend of
all. A. its base class(es)
B. its derived class(es)
32. What constraints does the compiler put C. any other friends of the class
on a const member function? D. none of the above
A. It cannot change any mutable data
member of the object on which it is called 37. Which of these is not true about static
B. It cannot change any non-mutable data data member?
member of the object on which it is called A. Can be accessed only static members
C. It cannot call any other non-const B. Each object of the class will have its
member function of the object on which it is own copy of static data member
called C. Memory will be allocates only once
D. It cannot change any non-mutable data during the class declaration
member, nor call any other non-const member D. When any object modifies static data
function, of the object on which it is called member , the result will be visible to all
instances of the class
33. A "friend" function is one which:
A. Belongs to a particular class, but (in 38. Which of these is false about static
some ways) acts like is doesn't. member functions?
B. Doesn't belong to a particular class, but A. Static member functions cannot be
(in some ways) acts like it does. defined in the private section of a class
C. Belongs to a particular class, but can be B. Can access only static data members of
called without referring to an object of that class. the class
D. Is a private member of a class, which C. Static member functions can invoke
exists just to "help" the public member functions other static member functions
D. Static member functions defined in the
34. Friend functions are useful because: public section of a class declaration can not be
A. They allow us to break the accessed without specifying an object of the
encapsulation of any class whenever we want to, class
which makes coding much easier since we don't
39. Which is the parameter that is added to a) 1 b) Compile time error c) 2 d) Run
every non-static member function when it is time error
called?
A. Constructor 43. Which of the following is not a type of
B. 'this' pointer constructor?
C. Void * A. Copy constructor
D. reference B. Friend constructor
C. Default constructor
40. To convert from a basic type to a user D. Parameterized constructor
defined class , which of these is necessary
A. Built in conversion 44. Which of the following statements is
B. A one argument constructor correct?
C. An operator function A. Base class pointer cannot point to
D. A conversion function that?s the derived class.
member of the class B. Derived class pointer cannot point to
base class.
41.What is the output of this C code(when 1 is C. Pointer to derived class cannot be
entered)? created.
#include <stdio.h> D. Pointer to base class cannot be created.
void main()
{
double ch; 45. Which of the following is not the member of
printf("enter a value btw 1 to 2:"); class?
scanf("%lf", &ch); A. Static function
switch (ch) B. Friend function
{ C. Const function
case 1: D. Virtual function
printf("1");
break;
case 2: 46. Which of the following concepts means
printf("2"); determining at runtime what method to invoke?
break; A. Data hiding
} B. Dynamic Typing
} C. Dynamic binding
a) Compile time error b) 1 c) 2 D. Dynamic loading
d) Varies

42. What is the output of this C code(When 1 is 47.Which of the following concepts provides
entered)? facility of using object of one class inside
#include <stdio.h> another class?
void main() A. Encapsulation
{ B. Abstraction
char *ch; C. Composition
printf("enter a value btw 1 to 3:"); D. Inheritance
scanf("%s", ch);
switch (ch)
{ 48.Which of the following is the correct class of
case "1": the object cout?
printf("1"); A. iostream
break; B. istream
case "2": C. ostream
printf("2"); D. ifstream
break;
}
}
49.Which of the following is the correct way of fstream
declaring a function as constant? iostream
A. const int ShowData(void) { /* 56. ios::trunc is used for ?
statements */ } A. If the file is opened for output
B. int const ShowData(void) { /* operations and it already existed, no
statements */ } action is taken.
C. int ShowData(void) const { /* B. If the file is opened for output
statements */ } operations and it already existed, its
D. Both A and B previous content is deleted and replaced
by the new one.
50.Which of the following ways are legal to C. If the file is opened for output
access a class data member using this pointer? operations and it already existed, then a
A. this->x new copy is created.
B. this.x D. None of above
C. *this.x 57. Which is correct syntax ?
D. *this-x A. myfile:open ("example.bin", ios::out);
B. myfile.open ("example.bin", ios::out);
51.Which of the following operators cannot be C. myfile::open ("example.bin", ios::out);
overloaded? D. myfile.open ("example.bin", ios:out);
A. [] 59. Which among following is correct syntax of
B. -> closing a file in c++ ?
C. ?: A. myfile$close();
D. * B. myfile@close();
C. myfile:close();
51. The fields in a structure of a C program are D. myfile.close();
by default 60. Which is used to handle the exceptions in
A.protected c++?
B.public A. catch handler
C.private B. handler
D.none of the above C. exception handler
52. When a class serves as base class for many D. none of the mentioned
derived classes, the situation is called:
A. polymorphism 61 Which statement is used to catch all types of
B. hierarchical inheritance exceptions?
C. hybrid inheritance a) catch()
D. multipath inheritance b) catch(Test t)
E. none of these c) catch(…)
53. When two or more classes serve as base d) none of the mentioned
class for a derived class, the situation is known
as __________. 62. How to handle error in the destructor?
A. multiple inheritance a) throwing
B. polymorphism b) terminate
C. encapsulation c) both a & b
D. hierarchical inheritance d) none of the mentioned
E. none of these
63. When the angle of incidence is _______ the
54. Multiple inheritance leaves room for a critical angle, the light beam bends along the
derived class to have _______ members. interface.
A. dynamic
B. private  A) less than
C. public  B) equal to
D. ambiguous  C) more than
E. none of these  D) none of the above
55. Which stream class is to only write on files ?
ofstream
ifstream
64. Transmission media lie below the _______  C) diameter of cable
layer.  D) outer conductor

 A) application 70. Signals with a frequency below 2 MHz use


 B) transport _______ propagation.
 C) network
 D) physical  A) line-of-sight
 B) sky
64. _________ cable consists of an inner copper  C) ground
core and a second conducting outer sheath.  D) none of the above

 A) Twisted-pair 71. In an optical fiber, the inner core is _______


 B) Shielded twisted-pair the cladding.
 C) Coaxial
 D) Fiber-optic  A) less dense than
 B) denser than
65. __________ consists of a central conductor  C) the same density as
and a shield.  D) another name for

 A) Twisted-pair 72. ________ cable consists of two insulated


 B) Coaxial copper wires twisted together.
 C) Fiber-optic
 D) none of the above  A) Twisted-pair
 B) Coaxial
66. _______ cable can carry signals of higher  C) Fiber-optic
frequency ranges than _______ cable.  D) none of the above

 A) Coaxial; twisted-pair 73. In fiber optics, the signal is _______ waves.


 B) Twisted-pair; fiber-optic
 C) Coaxial; fiber-optic  A) radio
 D) none of the above  B) light
 C) infrared
67. _________ are used for cellular phone,  D) very low-frequency
satellite, and wireless LAN communications.
74. Signals with a frequency above 30 MHz use
 A) Radio waves _______propagation.
 B) Infrared waves
 C) Microwaves  A) line-of-sight
 D) none of the above  B) sky
 C) ground
68. The inner core of an optical fiber is _______  D) none of the above
in composition.
75. A parabolic dish antenna is a(n) _______
 A) copper antenna.
 B) glass or plastic
 C) bimetallic  A) unidirectional
 D) liquid  B) bidirectional
 C) omnidirectional
69. What is the major factor that makes coaxial  D) horn
cable less susceptible to noise than twisted-pair
cable? 76. A(n) _______ medium provides a physical
conduit from one device to another.
 A) insulating material
 B) inner conductor  A) unguided
 B) guided 83. Which of the following primarily uses
 C) either (a) or (b) guided media?
 D) none of the above
 A) radio broadcasting
77. ________ cable is used for voice and data  B) satellite communications
communications.  C) local telephone system
 D) cellular telephone system
 A) Twisted-pair
 B) Coaxial 84. When a beam of light travels through media
 C) Fiber-optic of two different densities, if the angle of
 D) none of the above incidence is greater than the critical angle,
_______ occurs.
78. Signals with a frequency between 2 MHz
and 30 MHz use _______ propagation.  A) refraction
 B) reflection
 A) ground  C) criticism
 B) line-of-sight  D) incidence
 C) sky
 D) none of the above 85. Which of the following is not a guided
medium?
79. Transmission media are usually categorized
as _______.  A) fiber-optic cable
 B) coaxial cable
 A) determinate or indeterminate  C) twisted-pair cable
 B) fixed or unfixed  D) atmosphere
 C) guided or unguided
 D) metallic or nonmetallic 86. Microwaves are _________.

80. ________ are used for short-range  A) omnidirectional


communications such as those between a PC and  B) bidirectional
a peripheral device.  C) unidirectional
 D) none of the above
 A) Radio waves
 B) Infrared waves 87. ________ cables carry data signals in the
 C) Microwaves form of light.
 D) none of the above
 A) Twisted-pair
81. _________ media transport electromagnetic  B) Coaxial
waves without the use of a physical conductor.  C) Fiber-optic
 D) none of the above
 A) Guided
 B) Unguided 88. Radio waves are _________.
 C) Either (a) or (b)
 D) None of the above  A) unidirectional
 B) omnidirectional
82. ________ cables are composed of a glass or  C) bidirectional
plastic inner core surrounded by cladding, all  D) none of the above
encased in an outside jacket.
89. In a fiber-optic cable, the signal is
 A) Twisted-pair propagated along the inner core by _______.
 B) Coaxial
 C) Fiber-optic  A) refraction
 D) none of the above  B) reflection
 C) modulation
 D) none of the above A.HTML
B.JavaScript
90.Which layer 1 devices can be used to enlarge C.Multiple inheritance
the area covered by a single LAN segment? D.All of them
Switch
NIC 96.Which is most important thing in
Hub configuration of PHP?
Repeater
RJ45 transceiver A.The php.ini file
A. 1 only B.Compile time options
B. 1 and 3 C.Web server configuration
C. 3 and 4 D.All of them
D. 5 only
91.Routers operate at layer _____. LAN 97.Which of the following statements is true?
switches operate at layer _____. Ethernet hubs A.Python is a high level programming language.
operate at layer _____. Word processing B.Python is an interpreted language.
operates at layer _____. C.Python is an object-oriented language.
A. 3, 3, 1, 7 D.All of the above.
B. 3, 2, 1, none
C. 3, 2, 1, 7 98.What is used to define a block of code (body
D. 3, 3, 2, none of loop, function etc.) in Python?
92.Which of the following describe router A.Curly braces
functions? B.Parenthesis
A. Packet switching C.Indentation
B. Packet filtering D.Quotation
C. Internetwork communication
D. Path selection 99.Which of the following is correct?
E. All of the above A.Variable name can start with an underscore.
93.Why does the data communication industry B.Variable name can start with a digit.
use the layered OSI reference model? C.Keywords cannot be used as a variable name.
It divides the network communication process D.Variable name can have symbols like: @, #, $
into smaller and simpler components, thus etc.
aiding component development, design, and
troubleshooting. 100.In the following code, n is a/an _______?
It enables equipment from different vendors to n = '5'
use the same electronic components, thus saving A.integer
research and development funds. B.string
It supports the evolution of multiple competing C.tuple
standards and thus provides business D.operator
opportunities for equipment manufacturers.
It encourages industry standardization by
defining what functions occur at each layer of
the model.
A. 1 only
B. 1 and 4
C. 2 and 3
D. 3 only
94.A receiving host has failed to receive all of
the segments that it should acknowledge. What
can the host do to improve the reliability of this
communication session?
A. Send a different source port number.
B. Restart the virtual circuit.
C. Decrease the sequence number.
D. Decrease the window size.
95.PHP offers no support for

Você também pode gostar