Tuesday, March 4, 2014

PLUS TWO COMPUTER SCIENCE STUDY MATERIAL

12. COMPUTER ETHICS

1. Which is the set of rules for deter mining moral standards?

(a) Programs (b) Cracking (c) Ethics (d) Crimes

2. Which refers to the protection of hardware?

(a) Data security (b) Physical security (c) Personnel security (d) Personal security

3 Making and using duplicate hardware and software is called

(a) Crime (b) Publicity (c) Piracy (d) Security

4. A self-replication program that can cause damage to data and files stored on the computer is

(a) Antivirus (b) Virus (c) Language (d) Bacteria

5. How many new viruses are found each day?

(a) 57000 (b) 6 (c) 55000 (d) 5700

6. The software runs on an idle computer without the knowledge of the organization is called

(a) Software time (b) Computer time (c) System time 
(d) Hardware time

7. Which of the following laws prevent computer crimes in India?

(a) Crime (b) Illegal (c) Cyber 
(d) Zero

8. The illegal access to the network is called

(a) Cracking (b) Accessibility (c) Security 
(d) Management

9. The illegal access to the computer hardware and software

(a) Browsing (b) Hacking (c) Chatting 
(d) Cracking

10. ''Cracking'' comes

(a) Transcription (b) Website Service (c) Data Security 
(d) Computer Crime

11. Which refers to software setups that permit only authorized access to the system?

(a) Personal security (b) Personnel security (c) Physical security 
(d) Data security

12. Which security refers to protecting data and computer system against dishonesty?

(a) Personnel (b) Physical (c) Data 
(d) Personal

13. How many percent of computer crimes happen within the company?

(a) 80 (b) 90 (c) 60  
(d) 70

14. How many known virus programs are in existence?

(a) 6 (b) 55000 (c) 5700  
(d) 57000

15. Which of the following is not a way of protection?

(a) Physical Security (b) Personal Security (c) Piracy  
(d) Personnel Security

16. Which of the following is the telephone based Shared Centre?

(a) Website Services (b) Call center (c) Medical Transcription (d) e-Governance

17. Computer ethics has its roots in the work of

(a) Norbert Wiener (b) Herman Hollirith (c) Charles Babbage (d) Blaise Pascal

11. IT ENABLED SERVICES

1. IT that helps in improving the quality of service to the users is called

(a) IT Evolution Studies (b) IT Enabled Studies

(c) IT Environment Studies (d) IT Enabled Services

2. ITES stands for

(a) IT Enabled Services (b) IT Evolution Studies

(c) IT Enabled Studies (d) IT Environment Studies

3. Which of the following traditional services are IT Enabled?

(a) Spreadsheet (b) All the other three choices (c) Word Processors (d) Databases

4. Which can be collected for one purpose that may be useful for some other purpose?

(a) Program (b) ITES (c) Computer (d) Data

5. BPO may be expanded as.

(a) Business Process Online (b) Business Publication Outsourcing

(c) Business Process Outsourcing (d) Business Publication Online

6. Which is defined as a telephone based shared service center for specific customer activities?

(a) Data Management (b) Call Centers (c) Medical Transcription (d) Digitization

7. The process of collecting, digitizing, and processing data is called as

(a) Data Management (b) Digitization (c) Call Centers (d) Medical Transcription

8. Which of the following is a permanent, legal document that formally states the result of a medical investigation?

(a) Medical Transcription (b) Digitization (c) Data Management (d) Call Centers

9. How many steps are involved in medical transcription?

(a) 4 (b) 2 (c) 5 (d) 3

10. Which refers to the conversion of non-digital material to digital form?

(a) Medical Transcription (b) Tele-Medicine (c) Call centers (d) Digitization

11. Which increases the employment opportunities?

(a) KPO (b) ITES (c) IT (d) BPO

12. A facility that allows the user to speak into a special device while typing a letter using computer is called

(a) Telephone (b) Cell phone (c) Speaker 
(d) Dictaphone

13. Which is the key for effective and profitable use of IT in organizations?

(a) Data Management (b) Digitization (c) Call Centers 
(d) Medical Transcription

14. Which services comprise punching data from manually filled forms and images?

(a) Tele-Medicine (b) Call Centers (c) Data Processing 
(d) Medical Transcription

15. Which is critical for the success of ITES?

(a) Computer Crime (b) Computer Virus (c) Computer Time 
(d) Computer Ethics

16. Which of the following is not an IT enabled services?

(a) Data management (b) e-Governance (c) Reservation 
(d) Tele-medicine

17. The two important aspects that must be ensured by the ITES provider are

(a) Customer security and needs (b) better look and feel

(c) Data security and customer privacy (d) personal security and customer satisfaction

10. IMPACT OF COMPUTERS ON SOCIETY

1. 85% of computer usage is

(a) Spreadsheet (b) Presentation (c) Word processing (d) Database

2. Which of the following permits banking from the comfort of the home by using Internet facilities?

(a) e-Learning (b) e-Commerce (c) e-Banking (d) e-Shopping

3. CBT stands for

(a) Computer Based Tools (b) Computer Based Techniques

(c) Coded Binary Tools (d) Computer Based Tutorials

4. The technical element used to reach out the benefits of IT to the common man is

(a) Connectivity (b) Affordable computers (c) All the other three choices (d) Software

5. Which enables data storage and management at home?

(a) Emotion Container (b) Memo frame (c) Personal Archives 
(d) Archive unit

6. Which is an easy interaction with other people through touch screen?

(a) Archive unit (b) Bookshelf (c) Memo frame 
(d) Personal creativity tool

7. Which of the following units will prevent people from acquiring bad habits?

(a) Archive unit (b) Personal Archives (c) Memo frame 
(d) Emotion Container

8. We can purchase any product, any brand, and any quantity from anywhere using

(a) e-Shopping (b) e-Learning (c) e-Commerce 
(d) e-Market

9. Which is an advanced data accessing system?

(a) Bookshelf (b) Memo frame (c) Archive unit (d) Personal creativity tool

10. Which of the following enables online educational programs leading to degrees and certifications?

(a) e-Commerce (b) e-Learning (c) e-Education (d) e-Shopping

11. ATM is an example for

(a) e-shopping (b) e-banking (c) digitization (d) transcription

12. Which of the following functions is used as electronic pets in computerized home?

(a) Robot (b) Interactive screen (c) Creative line (d) Projection TV

13. What is useful in computer based education?

(a) Teaching (b) e-shopping (c) CBT (d) Transcription

14. Which is useful in computer-related functions?

(a) e-banking (b) e-shopping (c) e-mail (d) Call centers

15. ATM means

(a) Auto Teller Machine (b) Arithmetic Teller Machine

(c) Automatic Teller Machine (d) Automated Teller Machine

16. How many technical elements are require by a common man reach the benefits of IT?

(a) 4 (b) 3 (c) 6 (d) 5

9. INHERITANCE

1. The process of creating new classes from the existing classes is

(a) Polymorphism (b) Encapsulation (c) Inheritance (d) Data Abstraction

2. Inheritance is a process of creating new classes

(a) Base classes (b) Parent classes (c) Super classes (d) Derived classes

3. The existing class is called as

(a) Sub class (b) Abstract class (c) Derived class (d) Base class

4. The default visibility mode is

(a) static (b) protected (c) private (d) public

5. A derived class inherits from multiple base classes is known as

(a) Multiple inheritance (b) Hybrid inheritance (c) Multilevel inheritance (d) Single inheritance

6. When a derived class inherits only from one base class is known as

(a) Multipath inheritance (b) Multiple inheritance (c) Multilevel inheritance (d) Single inheritance

7. The class from which the new classes are derived is known as

(a) Base (b) Child (c) Derived (d) Sub

8. Which of the following class is a power packed class with additional attributes and methods?

(a) Derived (b) Static (c) Abstract (d) Base

9. Which of the following class inherits all the properties of the base class?

(a) Abstract (b) Super (c) Base (d) Derived

10. Which keyword is used to define a derived class?

(a) base (b) class (c) derived (d) sub

11. Access specifier is also referred to as

(a) Accessibility (b) Visibility mode (c) Acceptability or Accessibility (d) Acceptability

12. The symbol that must be used between derived and base class is

(a) : (b) :: (c) & (d) #

13. Which are not inherited but are executed first when an instance of the derived class is created?

(a) Data Members (b) Member functions (c) Destructors 
(d) Constructors

14 Which form of inheritance is reflected by the transitive nature of inheritance?

(a) Multilevel (b) Multiple (c) Hierarchical  
(d) Single

15. Classes used only for deriving other classes are called as

(a) Super classes (b) Abstract classes (c) Static classes  
 (d) Concrete classes

16. Read the following declarations:

class vehicle
{
int wheels ;
public:
void inputdata(int, int);
void outputdata( );
protected:
int passenger;
};

class heavy_vehicle:protected vehicle
{
int diesel _petrol;
protected:
int load;
public:
void readdata(i nt, int);
void write data() ;
};

class bus:private heavy_vehicle
{
char marks[20];
publ ic:
void fetchdata(char) ;
void displaydata( );
};

Which is the base class of the heavy_vehicle?

(a) vehicle (b) both bus and vehicle (c) heavy_Vehicle 
 (d) bus

17. The data member that can be accessed from the function displaydata() is

(a) load (b) passenger (c) marks (d) all these three choices

18. The member function can be accessed by an object of bus class is ___ ___ ___ ___ .

(a) None of other three choices (b) inputdata, outputdata

(c) readdata, writedata (d) fetchdata, displaydata

19. The most powerful feature of an object oriented programming language is

(a) Encapsulation (b) Class (c) Polymorphism (d) Inheritance

20. Which of the following is a class from which other classes are de rived?

(a) Derived class (b) Base class (c) Function class (d) Super class

21. How the derived class should be indicated?

(a) Class der_name, visibility mode, base class_id 


(b) Class der_name :: visibility mode base class_id

(c) Class der_name : visibility mode base class_id

(d) Class der_name ; visibility mode base class_id

22. Read the following declarations:

class A

int x,y;

protected:
int s,t;

public:
int u, v;
};

class B:public A
{

};

The data members that inherit from Class A to Class B

(a) u, v (b) x, y (c) Both s,t and u, v (d) s, t

23. u, v data members contain which visibility mode in Class B?

(a) Public (b) Private (c) Either Private or Protected (d) Protected

24. s,t data members contain which visibility mode in Class B?

(a) Static (b) Protected (c) Private (d) Public

25. What must be used between derived and visibility modes?

(a) ; (b) :: (c) : (d) !

26. For which class, objects cannot be declared?

(a) Abstract (b) Destructor (c) Void (d) Constructor

8. CONSTRUCTORS AND DE STRUCTORS

1. Which of the following gets executed, when an instance of a class comes into scope?

(a) Overloading (b) Destructor (c) Constructor

2. Which of the following initializes the class object?

(a) friend function (b) member function (c) inline function

3. When a class object goes out of scope, a special function that gets executed is

(a) Destructor (b) Destroy (c) End

4. The constructor and the destruct or have the same name as the

(a) Function (b) Object (c) Variable

5. Which are special functions of classes?


(d) Encapsulation
(d) constructor function
(d) Constructor
(d) Class

(a) Encapsulation (b) Both Constructors and Destructors


(c) Constructors (d) Destructors






6. Which of the following functions return nothing?






(a) Destructor (b) Both Constructors and Destructors






(c) Pointer (d) Constructor
























7. The constructor add( ) is called as


(a) New (b) Non-parameterized (c) Parameterized (d) Copy


8. Which is a function that removes the memory of an object?


(a) Destructor (b) Scope (c) Pointer (d) Constructor


9. The destructor is prefixed with the symbol


(a) ~ (b) & (c) :: (d) ?:


10. Which is executed at the time of program termination?


(a) Polymorphism (b) Class (c) Constructor (d) Destructor


11. Which of the following are not associated with any data type?


(a) Constructor and destructor (b) Functions


(c) Destructors (d) Constructors


12. The memory space is allocated to an object using


(a) Instance (b) Constructor (c) Destructor (d) Overloading


13. The constructor without any parameter is called as


(a) Parameterized constructor (b) Copy constructor


(c) Default constructor (d) Standard constructor


14. The constructor defined by the computers in the absence of user defined constructor


(a) Parameterized (b) Default (c) Destructor (d) Copy


15. The constructor add( add &a ) is called as ----------- constructor.


(a) Parameterized (b) Default (c) Copy (d) Non-parameterized


16. The constructor add( int s1, int s2) is called as ----------- constructor.


(a) Copy (b) Parameterized (c) Non-parameterized (d) Default


17. Which is executed automatically when the control reaches the end of the class scope?


(a) Destructor (b) Constructor (c) Function (d) Overloading


18. When an object is passed by reference to constructor, the constructor that is executed is


(a) Parameterized (b) Non-parameterized (c) Default (d) Copy


19. Which of the following cannot be overloaded?


(a) Constructor (b) Operator (c) Destructor (d) Function


20. How many destructors are present in a class?


(a) any number (b) 2 (c) 3 (d) 1


21. Which of the following cannot have arguments?


(a) Function overloading (b) Operator overloading (c) Constructor (d) Destructor


22 Constructor should be declared under the scope


(a) private (b) pointer (c) public (d) protected


23. Which of the following is not true?






(a) Constructors can have parameters


(c) Constructors cannot be overloaded


24. Read the following C++ snippet:


class simple


{


private :


int x;


public:


simple(int y)


{


x=y;


}


~simple ()


{


}};


What is the name of the constructor?


(a) simple (b) public














(b) Destructors cannot be overloaded


(d) Constructors is executed automatically


































































(c)private (d) ~simple

























25. Read the following C++ snippet:
class simple


{


private :
int x;


public:


simple (int y)
{


x=y;
}


~simple ()
{


}


};


What type of constructor is used in this snippet?


(a) Parameterized (b) Copy (c) Non-parameterized (d) Data hiding


26. Which of the following is true?


(a) A destructor can have arguments (b) Constructor returns int type


(c) Constructor can have arguments (d) A destructor has a return type


27. Which of the following constructors is executed when a member function returns an object?


(a) Complier generated constructor (b) Default constructor


(c) Non-parameterized constructor (d) Copy constructor


28. Read the following snippet:
class simple


{


private :
int x;


public:


simple (int y)
(x=y);


};


void main()
{


simple s(6);
}


How many objects are created?





(a) 7 (b) 1 (c) 0 (d) 6

7. POLYMORPHISM

1. In C++, polymorphism is achieved through

(a) Inheritance (b) Encapsulation (c) Data hiding (d) Overloading

2. In how many ways polymorphism is achieved in C++?

(a) 3 (b) 4 (c) Many (d) 2

3. Which of the following terms means a name having two or more distinct meanings?

(a) Inheritance (b) Overriding (c) Encapsulation (d) Overloading

4. Which refers to a function having more than one distinct meaning?

(a) Overloaded operator (b) Overloaded operand

(c) Overloaded expression (d) Overloaded function

5. The ability of function to process the message in more than one form is called as

(a) Function overloading (b) Data abstraction (c) Operator overloading (d) Data hiding

6. Which strategy is adopted by the compiler when functions are invoked in function over loading?

(a) First Match (b) Matching (c) Match Best (d) Best Match

7. Which adopts best match strategy to invoke function over loading?

(a) Compiler (b) Overloaded function(c) Interpreter (d) Overloaded operator

8. The mechanism of giving special meaning to an operator is called as

(a) Function overloading (b) Operator overloading

(c) Data overloading (d) Variable overloading

9. How many explicit argument(s) are taken by binary operators overloaded through a member function?

(a) 4 (b) 3 (c) 1 (d) 2

10. During integral promotion, a char data type can be converted to

(a) float (b) integer (c) double (d) all the other three choices

11. Which data type can be converted to integer/char/double in integral data promotion?

(a) double (b) float (c) int (d) char

12. Which data type can be converted to char/double /float in integral data promotion?

(a) float (b) double (c) char (d) int

13. Which of overloaded functions are not considered by the C++ compiler as part of the parameter list?

(a) Formal arguments (b) Default arguments (c) Actual arguments 
(d) Dummy parameters

14. Which of the following operators can be over loaded?

(a) Membership (b) Unary (c) sizeof 
(d) Conditional

15. Which of the following is used to declare the operator function?

(a) method( ) (b) function( ) (c) void( ) 
(d) operator( )

16 Which of the following must have atleast one operand of use defined type?

(a) Constructor overloaded   
(b) Operator overloaded

(c) Function overloaded      
(d) Method overloaded

17. Which function is used to concatenate strings?

(a) strcmp( ) (b) strplus( ) 
(c) strcpy( ) (d) strcat( )

18. The sign for membership operator is

(a) ?: (question colon) (b) :: (double colon) 
(c) . (dot) (d) : (colon)

19. Which operator is used to concatenate two objects of the type Strings?

(a) + (b) * (c) & (d) and

20. Which is one of the facets of C++ that supports object oriented programming?

(a) Data hiding (b) Operator overloading (c) Data abstraction (d) Function overloading

21. The prototype of the overloaded member function is
(a) negative operator - () (b) void operator - (negative) (c) void operator - () (d) void operator minus

22. Which of the following statements invokes the over loaded member function?

(a) Negative n1() (b) n2+; (c) -n2; (d) --n2()

23. Which of the following cannot have same return type ?

(a) void fun(int x, int y); void fun(int x, float y); (b) int fun(int x); void fun(float x);

(c) void fun(int x); void fun(int y); (d) void fun(char x); void fun(char x, int y);

24. In operator overloading, the operator functions must be defined as

(a) member function (b) either member function or friend function

(c) None of these three choices (d) friend function

25. Which of the following operators cannot be over loaded?

(a) += (b) ++ (c) + (d) ::

26. While over loading functions, the possible integral promotions are

(a) Both int_char and char_int (b) char_int (c) int_char (d) None of these

27. The functionality of '+' operator can be extended to strings through

(a) operator overloading (b) function overloading (c) class (d) inheritance

28. The over loaded operator must have atleast one operand of

(a) user-defined type (b) derived (c) array (d) built-in type

29. During over loading of which of the following operators, the left hand object must be an object of their relevant class

(a) Unary (b) None of these three choices (c) Binary (d) Ternary

30. The over loaded function definitions are permitted for which of the following data types?

(a) All of these three choices (b) User defined (c) Derived (d) Built in

31. Which of the following is not true related to function over loading?

(a) Do not use the same function name for two unrelated functions

(b) The return type of overloaded functions may be the same data type.

(c) Each overloaded function must differ by the number of its formal parameter.

(d) The default arguments are considered by the C++ compiler as part of the parameter list

32. Integral promotions are purely -------

(a) program oriented (b) compiler oriented (c) data oriented (d) computer oriented

33. The function operator() is declared in which part of the class ?

(a) static (b) private (c) public (d) protected

34. Which of the following statement is false in case of operator overloading?

(a) Only existing operators can be overloaded

(b) Binary operators overloaded through member function take one explicit argument

(c) The overloaded operator must have at least one operand of user defined type

(d) The basic definition of an operator can be replaced

6. CLASSE S AND OBJECTS

1. Which is a new way of creating and implementing a user defined data type?

(a) Polymorphism (b) Class (c) Encapsulation (d) Inheritance

2. Which provides a new method for packing together data of different types?

(a) Inheritance (b) Encapsulation (c) Polymorphism (d) Class

3. Which is a way to bind the data and it s associated functions together?

(a) Encapsulation (b) Inheritance (c) Class (d) Polymorphism

4. How many parts are there in a class specification?

(a) 4 (b) 3 (c) 5 (d) 2

5. The body of a class is enclosed within a

(a) [ ] (b) < > (c) { } (d) ( )

6. Every class declaration is terminated by

(a) :: (double colon) (b) ; (semicolon) (c) . (dot) (d) , (comma)

7. How many access specifiers are there in a class?

(a) 4 (b) 5 (c) 3 (d) 2

8. The class body contains the declaration of

(a) Variables and Functions (b) Variables and Arrays

(c) Pointers and Functions (d) Functions and Arrays

9. Which of the following class visibility label is optional?

(a) public (b) all the other three choices (c) protected (d) private

10. Which members can be accessed only from within the class?

(a) protected (b) global (c) public (d) private

11. Which members can be accessed from within the class and the members of the inherited classes?

(a) public (b) global (c) protected (d) private

12. Which members can be accessed from outside the class also?

(a) protected (b) global (c) public (d) private

13. The binding of data and functions together into a single entity is referred to as

(a) Data Hiding (b) Abstraction (c) Inheritance (d) Encapsulation

14. Data abstraction in C++ is achieved through

(a) Polymorphism (b) Inheritance (c) Data Hiding (d) Encapsulation

15. Which of the following is achieved through data hiding?

(a) Class Members (b) Class (c) Data Abstraction (d) Polymorphism

16. Class comprises of

(a) Members (b) Data types (c) Pointers (d) Arrays

17. Which of the following are data variables that represent the features or properties of a class?

(a) Data members (b) Structures (c) Arrays (d) Member functions

18 Which access specifier is used to access friend functions?

(a) private (b) protected (c) class (d) public

19. How many classifications of members are there?

(a) 2 (b) 3 (c) 4 (d) 5

20. What are the special member functions of classes?

(a) Constructors and Destructors (b) Constructors and Methods

(c) Constructors and Attributes (d) Constructors and Abstractors

21. In how many ways, the methods of a class can be defined?

(a) 2 (b) 5 (c) 3 (d) 4

22. A member function can call another member function directly is called as

(a) Friend functions (b) Inline functions (c) Nesting functions (d) Recursive functions

23. The variable that is initialized only when the first object of it s class created is

(a) static (b) private (c) protected (d) public

24. The static member variable is initialized to

(a) true (b) 0 (c) 1 (d) false

25. Which is the default access specifier?

(a) private (b) static (c) public (d) protected

26. A class which contains more than one object is called as

(a) Nested objects (b) Linked objects (c) Arrays of objects (d) Multi objects

27. Initially C++ was called as 'C with Classes' by

(a) ken Thompson (b) James Gosling (c) Bjarne Stroustrup (d) Charles Babbage

28. In the class, by default the members will be treated as.

(a) public (b) global (c) private (d) protected

29. The members and functions declared under private are not accessible by members outside the class is referred as

(a) Inheritance (b) Data hiding (c) Polymorphism (d) Encapsulation

30. Instruments allowing only selected access of components to object and to members of other classes is called as

(a) Data Hiding (b) Encapsulation (c) Polymorphism (d) Data Abstraction

31. In C++, the member functions are called as

(a) Methods (b) Attributes (c) Operators (d) Operands

32. In C++, Data members are called as

(a) Member functions (b) Attributes (c) Pointers (d) Methods

33. In C++, the class variables are known as

(a) Constants (b) Functions (c) Methods (d) Objects

34. The members of a class are accessed using the operator

(a) :: (double colon (b) : (colon) (c) , (comma) (d) . (dot)

35. The private data of a class can be accessed only through the member functions of its own class and certain special functions are called as ------------functions.

(a) recursive (b) inline (c) friend (d) nested

36. The members defined within the class behave

(a) inline functions (b) arrays (c) user defined functions (d) structures

37. The memory space required for the float member variable

(a) 8 bytes (b) 1 byte (c) 4 bytes (d) 2 bytes

38. Which member variable’s initial value is done outside the class?

(a) auto (b) static (c) extern (d) register

39. Which data members are not related to any specific object of the class but are shared by all the objects of the class?

(a) public (b) private (c) protected (d) static

40. Which of the following is not a valid class access specifier?

(a) protected (b) private (c) pointer (d) public

41. Which is the key feature of OOPS?

(a) Abstraction (b) Encapsulation (c) Data hiding (d) Data cancelling

42. The function associated with the class data type is called

(a) Arrays (b) Methods (c) Pointers (d) User defined data types

43. Which of the following statements is NOT true ?

(a) The return type of a member function cannot be of object data type

(b) A non-member function cannot access the private data of a class

(c) Several different classes can use the same function name

(d) Member functions can be of static type

44. Which of the following is the part s of a class specification?

(a) Arrays and Functions (b) Pointers and Arrays

(c) Datatypes and Pointers (d) Class declaration and Class function definitions

45.

class product
{
int c, q;
float p;
} p1;
The number of bytes occupied by p1 is

(a) 7 (b) 9 (c) 8 (d) 10

46. The member function declared under ------------ scope can be accessed by the objects of that class.

(a) protected (b) public (c) private (d) global

47. The variable shared by all the objects of a class, it behaves like

(a) Static (b) Private (c) Extern (d) Auto

48. Which of the following is the most important feature of C++?

(a) Function (b) Array (c) Class (d) Pointer

49. Which is used to create user defined data type?

(a) Derived class (b) Base class (c) Data hiding (d) Class

50. How many copy(copies ) of the member variable is (are) created if it is static memory?

(a) Two (b) Three (c) One (d) Four

51.

class product
{
int a,b;
float P;
public:
void assign_data();
void display( );
};

void main( )
{
product P1, P2;
}

The number of memory bytes allotted for the variable P1 is

(a) 8 (b) 12 (c) 4 (d) 10

52. Class name is also called as

(a) function (b) method (c) member (d) tag

53. Which of the following class access specifiers is optional?

(a) Private (b) Protected (c) Public (d) Class

54. How many copy of the member variable is created if it is static memory?

(a) 1 (b) 2 (c) 4 (d) 3

55. Which of the following is true?

(a) Member function cannot be defined outside the class

(b) A class cannot have more than three member functions

(c) Member functions must all have same name

(d) Member function can be defined outside the class also

56. When objects are created, no separate space is allotted

(a) member functions (b) static member (c) data member (d) objects

57.

class example
{
int x,y, z;
float m,n;
}p[5] ;

In the above snippet how many objects are created?

(a) 5 (b) 4 (c) 3 (d) 1

58.

#i nclude <iostream.h>
#i nclude <conio.h>
class item

{
int code, quantity;
float price ;

void getdata( )
{
cout<< "\n Ente r code , quantity and price :";
cin>> code>> quantity>>price ;
}
protected:

void compute ( )
{

if( quantity>100)
tax=2500;

else

tax=1000;
}

public :
float tax;

void putdata( )
{

cout<< "\n Code :"<< code ;
cout<< "\n Quantity:" << quantity;
cout<< "\n Price :" << price ;
cout<< "\n Tax:"<< tax;
}

};

void main()
{
item i;
}

Memory allocation for instance "i" is

(a) 8 bytes (b) 12 bytes (c) 10 bytes (d) 16 bytes

59. public data member in the above class definition is

(a) code (b) price (c) tax (d) quantity

60. Method that can be accessed by object "i" is

(a) putdata() (b) getdata() (c) compute() (d) quantity()

5. STRUCTURED DATA TYPE ARRAY


1. Which of the following is a de rived data type that can hold several values of the same type in C++?

(a) Function (b) Pointer (c) Array (d) Reference

2. The collection of variable s of the same type that are referenced by a common name is

(a) Structure (b) Function 
(c) Pointer (d) Array

3. The size of the array should always be

(a) Positive (b) Negative 
(c) Float (d) Double

4. How many type s of arrays are there in C++?

(a) 5 (b) 3 
(c) 2 (d) 4

5. The process of arranging the data in an order in a given array is called

(a) Sorting (b) Filtering (c) Merging (d) Searching

6. Which are treated as single dimensional array of characters?

(a) Literals (b) Integers (c) Floats (d) Characters

7. A character array should be terminated with a symbol

(a) /0 (b) \x (c) 0 (d) \0

8. Which is the member function of standard input stream?

(a) puts( ) (b) gets( ) (c) read( ) (d) getline( )

9 .Which is the member function of standard output stream?

(a) write( ) (b) cin (c) getline( ) (d) gets( )

10. How many parameters are re qui red for write ( ) function?

(a) 3 (b) 2 (c) 5 (d) 4

11. In which header file, string manipulators are defined?

(a) string.h (b) ctype.h (c) conio.h (d) iostream.h

12. Which string function copies source string to target string?

(a) strlen( ) (b) strcmp( ) (c) strcopy( ) (d) strcpy( )

13. Which string function returns the number of characters stored in an array?

(a) strcmp( ) (b) strlen( ) (c) strlength( ) (d) strcpy( )

14. Which array is stored in sequential memory blocks?

(a) 1-D (b) 4-D (c) 3-D (d) 2-D

15. In which type of arrays, matrices can be represented?

(a) 1D-arrays (b) 2D-arrays (c) 4D-arrays (d) 3D-arrays

16. An array of strings is a character array of the type

(a) 4-D (b) 3-D (c) 2-D (d) 1-D

17. Which array is an array in which each element is itself an array?

(a) 1-D (b) Literal (c) 2-D (d) String

18. The array subscripts always commences from

(a) 0 (b) any one number (c) 1 (d) 2

19. The memory required for the integer array num_array[5]; is

(a) 5 bytes (b) 4 bytes (c) 10 bytes (d) 15 bytes

20. The second index of the 2-D array refers to

(a) Column (b) Length (c) Size (d) Row

21 An integer array with indexes from 0 t o 4, all having value 1 may be declared and initialized as

(a) int x[4] = {1}; (b) int x[4] = {1,1,1,1}; (c) int x[ ] = { }; (d) int x[5] = {1,1,1,1,1};

22. To treat spaces as part of string literal, one has to use

(a) getline( ) (b) gets( ) (c) gets( ) or getline( ) (d) puts( )

23 Which member function treats white space or carriage return as terminator for string?

(a) getline( ) (b) gets( ) (c) cin (d) cout

24. The function strcpy(s1, s2)

(a) Appends s2 to end of s1 (b) Copies s1 to s2

(c) Appends s1 to end of s2 (d) Copies s2 to s1

25. What will be output of the following snippet?
char s1[ 3]=”exam”;
char s2[ 3]=”exam”;
st rcmp(s1,s2);

(a) 0 (b) >0 (c) error (d) <0

26 What will be the size of the array float num[4] [6];?

(a) 10 bytes (b) 96 bytes (c) 48 bytes (d) 24 bytes

27 How many number of element scan be stored in the array int sales[2][4]; ?

(a) 7 (b) 6 (c) 8 (d) 16

28. Deter mine the number of elements in the following array declaration int array[10][12];

(a) 480 (b) 240 (c) 120 (d) 22

29. Determine the number of elements in the following array declaration int x[ ][2]={0,1,1,2,2,3};

(a) 2 (b) can't determine (c) 6 (d) 3

30. short fine [ 'A']['E']; declares a two dimensional array with number of rows and columns of

(a) 26, 30 (b) 65, 69 (c) 1,5 (d) 97, 101

31. Arrays in C++ belong to which of the following data type?

(a) Primitive (b) Derived (c) Basic (d) User defined

32. In a 2-D array, the first sub-script stands for

(a) column (b) diagonal (c) object (d) row

33. Which of the following is a 2-dimensional character array?

(a) Array of strings (b) Literals (c) Matrix (d) Strings

34. Which of the following is an invalid array declaration?

(a) int array[]; (b) const int i=10; int array[i];

(c) Both int array[]; and int array[i]; (d) int array[i];

35. Which of the following functions compares the two given strings?

(a) cmpstr() (b) strcpy() 
(c) cpystr() (d) strcmp()

36. Strings are otherwise called as

(a) characters (b) literals 
(c) names (d) constants

37. write() is a member function

(a) All of these three choices 
(b) string.h (c) istream.h (d) ostream.h

38. Memory allotted for int num[2][4]; is

(a) 16 bytes (b) 10 bytes (c) 120 bytes (d) 60 bytes

39. Array parameter by de fault behaves like which parameter?

(a) Reference (b) Variable (c) Constant (d) Value

40. In the array, int sales[2][4]; the first row and second column is

(a) sales[1][2] (b) sales[2][1] (c) sales[0][1] (d) sales[1][0]

4. FUNCTIONS

1. The building blocks of C++ programs are

(a) Functions (b) Arrays (c) Classes (d) Statements

2. Which of the following statements marks the end of the function and also transfers control to the statement after call statement?

(a) return (b) continue (c) main 
(d) break

3. Which induce the reusability of the code?

(a) Variables (b) Functions (c) Keywords 
(d) Instructions

4. A function can be called or invoked from another function by using its

(a) Parameters (b) Name (c) Reference (d) All the other three choices

5. Which of the following can be shared by other programs by compiling and loading them together?

(a) Function (b) Variable (c) Statement (d) Token

6. Parameters are separated or delimited by

(a) scope resolution operator (b) period (c) commas (d) semicolon

7. Which communicates with the function through arguments or parameters?

(a) data type (b) call statement (c) name (d) variable

8. What are channels through which data flows from the call statement to the function?

(a) Parameters (b) Function names (c) Operators (d) Data types

9. In how many ways functions that have arguments can be invoked?

(a) 3 (b) 2 (c) 1 (d) 4

10. The parameters associated with function header is called as

(a) Function (b) Formal parameters (c) Actual parameters (d) Arguments

11. The function that returns no value is declared

(a) void (b) float (c) int (d) default

12. Which of the following refers to the accessibility of a variable?

(a) void (b) storage class (c) Scope (d) inline

13. How many scopes are there in C++?

(a) 3 (b) 1 (c) 2 (d) 4

14. Which operator reveals the hidden scope of a variable?

(a) Scope (b) Relational (c) Assignment (d) Binary

15. Which of the following act as place holders in function prototype?

(a) Statements (b) Constants (c) Variables (d) Keywords

16. The calling function parameters are called as

(a) duplicate parameters (b) actual parameters (c) dummy parameters (d) formal parameters

17. Which of the following reduce the size of the program?

(a) Variables (b) Functions (c) Arrays (d) Classes

18. In which method, any change made in the formal parameter is not reflected back to the actual parameters?

(a) void (b) inline (c) call by value (d) call by reference

19. Which functions execute faster but require more memory space?

(a) regular (b) normal (c) void (d) inline

20. The return type of the function prototype float power (float, int) is

(a) double (b) float (c) char (d) int

21. Which of the following keywords is just a request to the compiler?

(a) inline (b) extern (c) auto (d) register

22. Which scope variable’s life time is the life time of a program?

(a) Function (b) Local (c) File (d) Class

23. In which method, any change made in the formal parameter is reflected back in the actual parameter?

(a) call by reference (b) inline (c) call by value (d) void

24. Which looks like a normal function in the source file but inserts the function’s code directly into the calling program?

(a) inline (b) main (c) scope (d) void

25. Which variables die when its block execution is completed?

(a) Function (b) Local (c) File (d) Class

26. Which scope is valid within block and all sub-blocks of function?

(a) Function (b) Class (c) File (d) Local

27. Which operator is used to distinguish local and file scope variables having the same name?

(a) Relational (b) Binary (c) Assignment (d) Scope

28. The default return data type of a function, if no data type is explicitly mentioned is

(a) double (b) char (c) int (d) float

29. Which of the following is NOT true, related to functions ?

(a) The default value in the formal parameters can be given in the form of variable initialization

(b) The default value for an argument can be given in between the argument list

(c) The actual parameters can be passed in the form of constants to the formal parameters of value type

(d) The actual parameters can be passed only as variables to formal parameters of reference type

30. In the following code, the scope of the variable 'a' is

if (x < y)
{
int a;
a++;
}

(a) File scope (b) Function scope (c) Class scope (d) Local scope

31. The scope of any variable used in the entire program is

(a) Class (b) Function (c) File (d) Local

32. The variable declared above all blocks and functions is called as

(a) Class Scope (b) File Scope (c) Local Scope (d) Function Scope

33. Which scope is not known outside their own code block?

(a) Class (b) Local (c) Function (d) File

34. Which is used to help the compiler to check the data requirements of the function?

(a) Function prototype (b) Function calling (c) Function Definition (d) Header files

35. In which method, the called function creates new variables to store the value of the arguments passed to it?

(a) Formal parameter (b) Call by value (c) Call by reference (d) Actual parameter

36. In C++, what can be assigned to the formal parameters of a function prototype?

(a) Values (b) Program (c) Default values (d) Default arguments

37. Parameters that are associated with function call statement are

(a) global parameters (b) local parameters (c) formal parameters (d) actual parameters

38. The prototype of the over loaded member function must differ

(a) both by the number of its arguments and their data types

(b) both by the number of its formal parameters and their data types

(c) either by the number of its arguments or their data types

(d) either by the number of its formal parameters or their data types

39. Which of the following is used to separate a set of actual parameter function?

(a) & (b) ;(semi-colon) (c) .(dot) (d) ,(comma)

40. The return type of the function prototype fact( float, char, double ); is

(a) flaot (b) double (c) int (d) char

41. Which of the following is called scope resolution operator?

(a) ?: (b) :: (c) & (d) *

3. BASIC STATEMENT

1. Which is a predefined object that corresponds to a standard input stream?

(a) cin (b) cout (c) cinput (d) coutput

2. Data is read from the keyboard during runtime by using the object

(a) c++in (b) cin (c) c++out (d) cout

3. In C++, which file comprises the combined properties of istream and ostream?

(a) iostream.h (b) stdio.h (c) string.h (d) conio.h

4. A preprocessor directive starts with the symbol

(a) \ (b) # (c) % (d) $

5. The operator >> is called as ------------

(a) Stream operator (b) Abstraction operator (c) Insertion operator (d) Extraction operator

6. The extraction operator is also called as

(a) Get from (b) Get to (c) Put to (d) Put from

7. Which of the following operators is called as insertion operator or put to operator?

(a) >> (b) > (c) < (d) <<

8. How many sections are there in C++ program?

(a) 5 (b) 2 (c) 3 (d) 4

9. Which of the following functions will be executed automatically when a C++ program is executed?

(a) call by reference (b) main (c) recursive (d) void

10. The program statements that cause a jump of control from one part of a program to another are called as

(a) Assignment (b) Control Structures (c) Loop (d) Declaration

11. How many major categories of control structures are there in C++?

(a) 5 (b) 2 (c) 3 (d) 4

12. Which is the simplest of all the decision statements?

(a) nested if (b) switch (c) Simple if (d) if - else

13. Which of the following execute a set of instructions repeatedly for a certain number of times?

(a) Loops (b) Selections (c) Statements (d) Operators

14. How many kinds of loops are there in C++?

(a) 3 (b) 4 (c) 2 (d) 1

15. Which loop is called as exit-check loop?

(a) while (b) do-while (c) do loop (d) for

16. Which of the following is an entry-check loop?

(a) while (b) switch (c) if (d) do-while

17. Which loop is called as an entry controlled loop?

(a) while (b) do loop (c) do-while (d) for

18. Which of the following statements forces the next iteration of the loop to take place by skipping the remaining code?

(a) break (b) end (c) continue (d) begin

19. Which of the following statements accomplishes jump from the current loop?

(a) Break (b) Switch (c) While (d) Continue

20. A program written in high level language is called as

(a) Executable code (b) User code (c) Object file (d) Source code

21. The machine-readable form of a program is called as ---------------

(a) User code (b) Computer code (c) Object file (d) Source code

22. Which translator programs create a machine-readable program from the source code ?

(a) Assembler (b) Interpreter (c) Converter (d) Compiler

23. Which operator extracts data from the input stream object and places the value in the variable to its right?

(a) Extraction (b) Abstraction (c) Stream (d) Insertion

24. Which operator directs the contents of the variable to its right to the object to its left?

(a) Abstraction (b) Extraction (c) Stream (d) Insertion

25. Which of the following variables get defined only when memory is fetched to store data?

(a) Function (b) Global (c) Local (d) Pointer

26. Which of the following statements chooses between two alternatives?

(a) switch (b) nested if (c) Simple if (d) if...else

27. Which decision statement creates branches for multiple alternatives sections of code, depending on the value of a single variable?

(a) switch (b) if...else (c) while (d) for

28. Every action block of switch statement should be terminated using

(a) break (b) continue (c) stop (d) return

29. Based on the position of the condition, how many classifications of loops are there in C++?

(a) 3 (b) 2 (c) 4 (d) 1

30. In which loop, condition marks the last statement of the body of the loop?

(a) while (b) for (c) switch (d) do-while

31. In for loop, which segment is evaluated before the commencement of every iteration?

(a) Increment (b) Any one of the choices (c) Test condition (d) Initialization

32. Nested if statement can be replaced by the statement of

(a) for (b) do-while (c) select case (d) switch case

33. An outer loop and an inner loop having the same control variable leads to

(a) Syntax error (b) Software error (c) Semantic error (d) Logical error

34. Which C++ file comprises of all standard declarations and definitions for predefined functions?

(a) Footer (b) Pointer (c) Program (d) Header

35. How many times the following loop will be executed? for(i=1;i<6;i++)

(a) 5 (b) 7 (c) 6 (d) 1

36. The break statement would exit only the

(a) Current function (b) Current program (c) None of these three choices (d) Current loop

37. The declarations for the object cin are available under the header file

(a) inputstream.h (b) stream.h (c) stdstream.h (d) istream.h

38. The statement which is used to exit from switch statement is

(a) exit (b) break (c) default (d) quit

39. Statement used in C++ to display messages and result is

(a) cin (b) print (c) printin (d) cout

40. Basic statements in C++ are constructed using

(a) operators (b) tokens (c) constants (d) variables

41. Read the following C++ program:
#i nclude < iostream.h>

void main()
{

int num=2;
do
{
cout << num*num <<'\t';
num +=1;
}
while (num<6);
}
Name the control variable used in the program.

(a) \t (b) num (c) None of these three choices (d) +=1

42. What is the test expression (condition) used?

(a) num (b) num * num (c) None of these three choices (d) (num<6)

43. How many times will the loop be executed?

(a) 4 (b) 5 (c) 3 (d) 6

44. What is the output of the following program?

(a) 4 9 16 25 (b) 0 4 9 25 (c) 2 4 9 16 25 (d) 6 4 6 8

45. The break statement would exit only the

(a) Current loop (b) Current program (c) Current function (d) None of these three choices

46. How many times will the following loop be executed? for(i =1; i<30; i++)

(a) 1 (b) 31 (c) 29 (d) 30

47. Which creates object files from source code?

(a) Program (b) C++ (c) Compiler (d) Computer

48. What is the error thrown by the compiler for the following snippet?
if(a>b);
cout <<"Greater";
e lse
cout <<"Lesser";

(a) Misplaced if ...... else (b) Misplaced if (c) Misplaced else (d) Misplaced else..... if

49. Which statement is used to skip a part of loop and start the next cycle of loop?

(a) Continue (b) Stop (c) Skip (d) Break

50. for(i =1;i<=10;i++) How many times is this loop executed?

(a) Ten times (b) Nine times (c) Not executed (d) Only one

51. Which is linked with libraries to create an executable file?

(a) Object code (b) Compiler (c) Programs (d) Source code

52. The declaration for the object cin is available in a header file called

(a) string.h (b) istream.h (c) conio.h (d) stdio.h

53. The appropriate declaration statement to initialize the variable 'name ' with the value 'Abdul Kalam' is

(a) char name[]= "Abdul Kalam";   
(b) char name= "Abdul Kalam";

(c) char[] name= "Abdul Kalam";    
(d) char []name= "Abdul Kalam";

54. Which of the following is an assignment operator?

(a) << (b) =  
(c) + (d) ==

55. While <( condition)> {...} loop is called as

(a) exit-check loop (b) nested loop  
(c) entry-check loop (d) multi-check loop

2. OVERVIEW OF C++

1. C++ was developed by --------------

(a) James Gosling (b) Rick Mascitti (c) Bjarne Stroustrup (d) Dan Bricklin

2. The basic types of elements essential for programming coding are collectively called as

(a) Identifiers (b) Keywords (c) Tokens (d) Constants

3. Which is the smallest individual unit in a program?

(a) Variable (b) Keyword (c) Tokens (d) Constant

4. Which are reserved words with special meaning to the language compiler?

(a) Tokens (b) Constants (c) Keywords (d) Identifiers

5. Which are also called as variables?

(a) Statements (b) Constants (c) Identifiers (d) Tokens

6. The hexadecimal integer is a sequence of digits starting with

(a) 0x (b) hex (c) 0 (d) 16

7. Which of the following letters is used to represent the floating-point constant in exponent form?

(a) F or e (b) F (c) E Only (d) E or e

8. Which constant contains a single character enclosed within single quote s?

(a) integer (b) string (c) floating point (d) character

9. Escape sequences are represented using characters prefixed with a

(a) * (b) / (c) \ (d) |

10. Non-graphic character constants are represented using

(a) Statements (b) Escape sequences (c) Variables (d) Comments

11. The full form of ASCII is ----------------

(a) American Standard Code for Information Interconnect

(b) American Standard Code for Interchange Information

(c) American Standard Code for Instruction Interchange

(d) American Standard Code for Information Interchange

12. Which is a sequence of characters surrounded by double quotes?

(a) string (b) character (c) word (d) numbers

13. Which of the following is the simple assignment operator?

(a) += (b) == (c) != (d) =

14. How many classifications of operators are there in C++?

(a) 3 (b) 13 (c) 14 (d) 12

15. The combination of operands and operators is called as

(a) Identifier (b) Equation (c) Variable (d) Expression

16. Which of the following operators is used to compare numeric values?

(a) Logical (b) Relational (c) Arithmetic (d) Assignment

17. Which of the following operators is a logical operator?

(a) OR (b) All the other three choices (c) NOT (d) AND

18. Which of the following are characters with a specific function?

(a) Operators (b) Identifiers (c) Punctuators (d) Constants

19. Which of the following data types is used to declare a generic pointer?

(a) char (b) string (c) int (d) void

20. Which data type indicates the compiler that the function does not return a value?

(a) string (b) int (c) char (d) void

21. Which variable holds the memory address of other variables?

(a) Pointer (b) Static (c) Dynamic (d) Temporary

22 Which of the following is user defined named entities of memory locations that can store data?

(a) Tokens (b) Constants (c) Keywords (d) Variables

23. Which qualifier specifies that the value of a variable will not change during the run time of a program?

(a) short (b) long (c) int (d) const

24. The operators use d only by the preprocess or are -------

(a) ++ and - - (b) # and ## (c) && and || (d) > and <

25. Which operator returns the memory requirement size of the given expression or data type in terms of bytes?

(a) signed (b) struct (c) static (d) sizeof

26. Which refers to the process of changing the data type of the value stored in a variable?

(a) Type cast (b) Conversion (c) Type modification (d) Data conversion

27. Which of the following punctuators is used to terminate a C++ statement?

(a) : (b) } (c) ] (d) ;

28. In C++, the single line comment should be preceded or prefixed

(a) \\ (b) /** */ (c) /* */ (d) //

29. In which year, C++ was developed?

(a) 1985 (b) 1990 (c) 1975 (d) 1980

30. A variable name must begin with -----------

(a) Alphabet or Underscore (b) Number (c) Alphabet (d) Underscore

31. Which is an invalid identifier?

(a) test12 (b) 1test (c) _test (d) test

32. The constant that should not have fractional part is called as a/an

(a) exponent (b) float (c) double (d) integer

33. The escape sequence used to produce bell sound is

(a) \t (b) \n (c) \b (d) \a

34. The end of a string literal is by de fault added with a special character

(a) \x (b) \\ (c) \0 (d) \a

35. Which is a scope access resolution operator in C++?

(a) :: (b) ?: (c) .* (d) -> *

36. Which is a ternary operator in C++?

(a) .* (b) :: (c) ?: (d) ->*

37. Which of the following operator requires two operands?

(a) Binary (b) Conditional (c) Ternary (d) Unary

38. Increment and decrement operators are called as

(a) Ternary (b) Unary (c) Arithmetic (d) Binary

39. Which of the following is an example for pre-increment operator?

(a) --a (b) ++a (c) a++ (d) a—

40. The conditional operator is

(a) -- (b) ?: (c) ?:; (d) ++

41. The punctuator used to enclose the block of comment statement is

(a) /* */ (b) // (c) [ ] (d) { }

42. Which data type helps in improving the credibility and readability of the program?

(a) Type defined (b) User defined (c) Built-in (d) Derived

43. Which of the following user defined data types allow users to define a variable that would represent an existing data type?

(a) typedef (b) union (c) class (d) enumeration

44. The user defined data type helps users in creating a list of identifier called

(a) class (b) enumeration (c) union (d) typedef

45. Auto variables get undefined values known as

(a) Scalar (b) Register (c) Garbage (d) Datatype

46. The modifier that allows the variable to exist in the memory of the computer, even after losing its scope is

(a) global (b) auto (c) static (d) extern

47. Which variables are global variables known to all functions in the current program?

(a) register (b) auto (c) static (d) extern

48. Which of the following is the fundamental (or) built in (or) basic data types?

(a) All the other three choices (b) Void (c) Float (d) Integral

49. Integral data type is classified into

(a) float and double (b) int and char (c) int and float (d) int and double

50. The address of the operator in a pointer data type is

(a) $ (b) & (c) * (d) #

51. Which of the following is not a C++ keyword?

(a) new (b) this (c) cont (d) if

52. Which of the following is not a C++ keyword?

(a) signed (b) size of (c) static (d) struct

53. The ASCII value of the character ‘a’ is

(a) 97 (b) a (c) 90 (d) 65

54. How many fundamental data type s are there in C++?

(a) 4 (b) 1 (c) 3 (d) 2

55. The enumeration integer const ants are starting with the value of

(a) 0 (b) 2 (c) 1 (d) any one value

56. The range of integer data type is

(a) -32768 to 32767 (b) -32767 to 32768 (c) -32678 to 32678 (d) -32768 to 32768

57. How many bytes doe s the unsigned int data type occupy?

(a) 2 (b) 1 (c) 3 (d) 4

58. Predict the output

#i nclude < ios tre am.h>
void mai n( )
{
int i=25;
cout << i << i++ << ++i;
}

(a) 25 26 27 (b) 27 26 26 (c) 25 25 26 (d) 25 25 27
59. int a ,b, c;
a=6;
b=7;
c = ( a++) - (--b) ;
cout << c;

The output of the above code, when it is executed is

(a) error (b) 9 (c) 0 (d) 11

60. Evaluate the expression a+=b* c where a =5, b=6, c=7.

(a) 37 (b) 77 (c) 42 (d) 47

61. The statement int A; b; is invalid because

(a) Capital A is not allowed

(b) Only one variable should be given

(c) Variables should be separated by comma

(d) All the other three choices

62. int i =6;

unsigned int j =10;
cout << sizeof (i *j) ;

The output when the above code is executed is

(a) 4 (b) 2 (c) 8 (d) error

63. If a=5 and b=4, the value of the expression a+b/2* 6 is

(a) 18 (b) 16 (c) 15 (d) 17

64. Which brace is used to enclose the body of the C++ program?

(a) () (b) {} (c) [] (d) <>

65 Which of the following defines a Local variable?

(a) Auto (b) Static (c) Register (d) Extern

66. Based on operand requirements, operators are classified as --------- type.

(a) 4 (b) 5 (c) 3 (d) 2

67. The storage specifiers that instruct the compiler to store the variable in the CPU register to optimise access

(a) static (b) auto (c) register (d) extern

68. What is the maximum range of unsigned integer data type?

(a) 255 (b) 65535 (c) 3.4e+10 (d) 32768

69. By default, the local variable is

(a) Extern (b) Static (c) Register (d) Auto

70. Which variables are automatically initialized to zero when they are declared?

(a) Static and Extern (b) Static and Register (c) Auto and Static (d) Register and Extern

71. Which of the following is the invalid variable declaration?

(a) int a,b; (b) int a; b; (c) int a; int b; (d) int a; float b;

72. Ternary operators require how many operands?

(a) Two (b) One (c) Four (d) Three

73. Relational operators have lower precedence than

(a) Boolean operators (b) Relational operators (c) Logical operators (d) Arithmetic operators

74. What is the value assigned to x?

fl oat x;
int a =7, b=3;
x= a/(float)b;

(a) Error (b) 3.0 (c) 2.0 (d) 2.33

75. Find the output:

#i nclude <iostream.h>
#i nclude <conio.h>
void main( )

{
int n1=10, *n2
n2=&n1;
n2++;
cout << n1;
}

(a) 12 (b) 10 (c) 13 (d) 11

76. Which of the following modifiers increases the bytes for a particular data type?

(a) Signed (b) Long (c) Short (d) Unsigned

77. Which of the following operators is also called conditional operator?

(a) Binary (b) Unary (c) Relational (d) Ternary

78. 0.5864E1 represents

(a) 5.864 (b) 0.05864 (c) 58.64 (d) 0.5864