+ All Categories
Home > Documents > c and c++

c and c++

Date post: 22-Nov-2014
Category:
Upload: ursvasu2k
View: 122 times
Download: 2 times
Share this document with a friend
Popular Tags:

If you can't read please download the document

Transcript

List of Questions S.No. Question 1 The language of object oriented program is [A] C [B] FORTRAN [C] PASCAL [D] C++ Answer : D 2 The feature of object-oriented program is (i). Emphasis on data (ii). Program is divided in to objects (iii). Only focus on data only (iv). Data is hidden [A] (i) only [B] (i) & (ii) & (iv) only [C] (iii) only [D] (iv) and (i) Answer : B Object is of type [A] Class type [B] Predefined type [C] Member function [D] Data Answer : A A class is [A] [B] [C] [D] Answer : A Collection of objects of similar type Collection of objects of dissimilar type Collection of member functions only Separated from the member function and object

3

4

5

The concept of object-oriented programming is (i). Polymorphism (ii). Encapsulation (iii). Muti-threading (iv) Inheritance [A] (i) only [B] (i), (ii), (iv) only [C] (ii) and (iii) only [D] (iv) only Answer : B

6

Any C++ program execution starts from [A] Main [B] Above the main [C] Without main [D] Outside the main Answer : A The operator > in one statement Answer : A 14 C front [A] [B] [C] [D] Answer : C Is front end of a C compiler Is the pre-processor of a C compiler Translates a C++ code to its equivalent C code None of the above

15 The C++ program implementations have extensions such as [A] .c [B] .C [C] .pp [D] All of the above Answer : D 16 The C++ compiler would produce [A] An object file [B] An executable file [C] Class file [D] Text file Answer : A 17 The output function in C++ used as [A] Printf [B] Scanf [C] Cout [D] Cin Answer : C 18 The software development components [A] Procedures [B] Methods [C] Tools [D] All of the above Answer : D 19 The classic software development life cycle contains [A] 5 steps

[B] 6 steps [C] 9 steps [D] Only 2 steps Answer : B 20 The life cycle method is called as [A] Water fall model [B] Win-win model [C] Spiral model [D] None Answer : A 21 Problem space contains [A] Objects defined in problem space during analysis [B] Solution specifier objects defined during analysis [C] Objects defined before the problem space [D] Objects defined after the problem space Answer : A 22 In a C++ program constant is defined [A] Before main [B] After main [C] Any where but starting on new line [D] Cannot be determined Answer : C 23 In header files whether functions are [A] Declared [B] Defined [C] Declared & determined [D] Initialized Answer : B 24 The polymorphism means in oops concept [A] Single form only [B] Single name to be used for more than one [C] Different names to be used for more than one [D] No name is used Answer : B 25 Which of the following is procedural language [A] Ada [B] Small talk [C] C++ [D] C Answer : D

26 Which is/are the following object-oriented languages [A] Smalltalk [B] C++ [C] Eiffel [D] All of the above Answer : D 27 The C++ developed by [A] Dennis Ritchie [B] Bjarne Strostrup [C] Clocksin & Mellish [D] J Hame Answer : B 28 Which header file contains the input stream [A] ostream.h [B] conio.h [C] iostream.h [D] stdio.h Answer : B 29 The out put stream symbol in C++ [A] >> [B] [C] [D] ~ Answer : D 35 The unary operator is [A] -[B] ++ [C] [D] +Answer : C 36 The symbol defined using # define are called as [A] Vector [B] Macro [C] Expression [D] Integer Answer : B 37 The statement terminator in C++ represented by [A] : [B] \n [C] \t [D] ; Answer : D 38 String constants are represented within [A] Single quotes [B] Double quotes [C] /* and */ [D] The braces Answer : A 39 Which is not keyword of C++

[A] [B] [C] [D] Answer : B

Const Main Sizeof Void

40 Tokens are separated by using [A] : [B] . [C] ; [D] Separator Answer : D 41 (1)A definition allocates memory space for a variable (2)A declaration allocates memory space for a variable (3)A definition can occur multiple times (4)A declaration can occur multiple times Regarding the difference between a declaration & a definition of a variable, which of the above statements are true? [A] (1)& (3) only [B] (1)&(4) only [C] (2)&(3) only [D] (2)&(4) only Answer : B 42 What is variable declaration? [A] The assignment of properties to a variable [B] The assignment of memory space to a variable The assignment of properties & memory space to [C] variable The assignment of properties and identification to a [D] variable Answer : D 43 The bit-wise AND is used for [A] Masking [B] Comparison [C] Division [D] Shifting bits Answer : A 44 Explicit type conversion is known as [A] Casting [B] Coercion

[C] Options a& b [D] Upward type conversion Answer : C 45 The symbol # in the #define statements must commence from [A] Any where in a line [B] The first column of a line [C] The first column of next line [D] The first line Answer : A 46 How the library functions are made available to a program? [A] By using #define statements [B] By linking loader to the program [C] By using #include statements [D] By using function declaration Answer : C 47 main() { double x=1/2.0-1/2; printf(x=%.2f\n,x); } What will be the output? [A] X=0.00 [B] X=0.25 [C] X=0.50 [D] X=1.00 Answer : C 48 The associativity of assignment operator is [A] Right to left [B] Left to right A for arithmetic expression and b for pointer [C] expression A for pointer expression and b for arithmetic [D] expression Answer : A 49 Dividing a program into functions [A] Is the key to object oriented programming [B] Makes the program easier to conceptualize [C] Makes the program run faster [D] May increase the size of program Answer : B 50 How many bytes occupies the char variable

[A] [B] [C] [D] Answer : C

4- bytes 2-bytes 1-byte 16-bits

51 Function prototyping is used to [A] Describe the function [B] Describe the number and type of arguments [C] Describe the return value only [D] Describe the parameters Answer : B 52 When a argument is passed by reference A variable is created in the function to hold the [A] arguments value [B] The function cant access the arguments value A temporary variable is used in the calling program to [C] hold the argument value The function access the argument original value in the [D] calling program Answer : A 53 Passing arguments to functions using reference is [A] To affect only the actual arguments [B] Same as the actual argument [C] Interchanging their values [D] No change in formal parameters Answer : A 54 What is the output of the following program Void swap (int &i, int &j) { int temp = i; i = j; j = temp; } main () { int a = 10, b = 3; swap (a, b); Cout


Recommended