Explore topic-wise MCQs in Technical Programming.

This section includes 1331 Mcqs, each offering curated multiple-choice questions to sharpen your Technical Programming knowledge and support exam preparation. Choose a topic below to get started.

1051.

If a, b and c are integer variables with the values a=8, b=3 and c=-5. Then what is the value of the arithmetic expression: 2 * b + 3 * (a-c)

A. 45
B. 6
C. -16
D. -1
Answer» B. 6
1052.

What is the output of the following C program? # include main ( ) { int a, b=0; static int c [10]={1,2,3,4,5,6,7,8,9,0}; for (a=0; a

A. 20
B. 25
C. 45
D. 90
Answer» B. 25
1053.

................ function converts an object of the class in which you define the function to an object of different data type.

A. conversion function
B. member function
C. class conversion
D. conversion constructors
Answer» D. conversion constructors
1054.

A ................. converts from an object of the type of the constructor parameter to an object of the class.

A. conversion function
B. member function
C. class conversion
D. conversion constructors
Answer» E.
1055.

The .................. functions are implementation independent.

A. inline
B. accessor
C. member
D. recursive
Answer» B. accessor
1056.

The size of operator returns the size of variable or type in ...............

A. bits
B. nibble
C. bytes
D. char
Answer» D. char
1057.

Every statement in C++ program should end with a ................

A. full stop (.)
B. comma (,)
C. semicolon (;)
D. colon (:)
Answer» D. colon (:)
1058.

Which of the following is false?

A. cout represents the standard output stream in c++
B. cout is declared in the iostream standard file
C. cout is declared within the std namespace
D. none of above
Answer» C. cout is declared within the std namespace
1059.

Every function in C++ is followed by ...................

A. parameters
B. parenthesis
C. curly braces
D. none of these
Answer» C. curly braces
1060.

Consider the following statements: int x = 6, y=8, z, w; y = x++; z = ++x; The value of x,y,z by calculating the above expressions are:-

A. y=8, z=8, x=6
B. y=6, x=8, z=8
C. y=9, z=7, x=8
D. y=7, x=8, z=7
Answer» C. y=9, z=7, x=8
1061.

The variable that are declared outside all the functions are called ............

A. Local variable
B. Global variable
C. Auto variable
D. None of the above
Answer» C. Auto variable
1062.

The size of following variable is not 4 bytes in 32 bit systems is ...............

A. int
B. long int
C. short int
D. float
Answer» D. float
1063.

Which of the following is not a reserve keyword in C++?

A. mutable
B. default
C. readable
D. volatile
Answer» E.
1064.

If you use same variable for two getline statements ..................

A. both the inputs are stored in that variable.
B. the second input overwrites the first one.
C. the second input attempt fails since the variable already got its value.
D. you can not use same variable for two getline statements.
Answer» C. the second input attempt fails since the variable already got its value.
1065.

Which of the following header file does not exist?

A. <iostream>
B. <string>
C. <sstring>
D. <sstream>
Answer» D. <sstream>
1066.

Which of the header file must be included to use stringstream?

A. <iostream>
B. <string>
C. <sstring>
D. <sstream>
Answer» E.
1067.

Which of the following is not a valid statement regarding stringstream?

A. Stringstream is defined in the header file <sstream>.
B. It allows string based objects treated as stream.
C. It is especially useful to convert strings to numerical values and vice versa.
D. None of these
Answer» E.
1068.

The difference between while structure and do structure for looping is .................

A. in while statement the condition is tested at the end of first iteration
B. in do structure the condition is tested at the beginning of first iteration
C. the do structure decides whether to start the loop code or not whereas while statement decides whether to repeat the code or not
D. in while structure condition is tested before executing statements inside loop where as in do structure condition is tested before repeating the statements inside loop
Answer» E.
1069.

Find out the error in following code. If (x = 100)

A. 100 should be enclosed in quotations.
B. There is no semicolon at the end of first line.
C. Equals to operator mistake.
D. Variable x should not be inside quotation.
Answer» D. Variable x should not be inside quotation.
1070.

A variable P is called pointer if ....................

A. P contains the address of an element in DATA.
B. P points to the address of first element in DATA
C. P can store only memory addresses
D. P contain the DATA and the address of DATA
Answer» B. P points to the address of first element in DATA
1071.

The memory address of the first element of an array is called ..................

A. floor addres
B. foundation address
C. first address
D. base address
Answer» E.
1072.

Set precision requires the ................ header file.

A. stdlib.h
B. iomanip.h
C. console.h
D. conio.h
Answer» C. console.h
1073.

If a function is declared as void fn(int *p), then which of the following statements is valid to call function fn?

A. fn(x) where x is defined as int x;
B. fn(x) where x is defined as int *x;
C. fn(&x) where x is defined as int *x;
D. fn(*x) where x is defined as int *x;
Answer» C. fn(&x) where x is defined as int *x;
1074.

What will be the output of the following code segment, if any? myfunc ( struct test t) { strcpy(t.s, “world”); } main( ) { struct test { char s[10]; } t; strcpy(t.s, “Hello”); printf(“%s”, t.s); myfunc(t); printf(“%s”, t.s); }

A. Hello Hello
B. world world
C. Hello world
D. the program will not compile
Answer» E.
1075.

Regarding #define which of the following statement is false?

A. it is not C++ statement but the directive for the pre-processor.
B. this does not require a semicolon at the end of line.
C. it is a C++ statement that declares a constant in C++.
D. none of the above.
Answer» D. none of the above.
1076.

Each pass through a loop is called a/an ...............

A. enumeration
B. iteration
C. culmination
D. pass through
Answer» C. culmination
1077.

A continue statement causes execution to skip to ...................

A. the return 0; statement.
B. the first statement after the loop.
C. the statement following the continue statement.
D. the next iteration of the loop.
Answer» E.
1078.

The directives for the pre-processors begin with ...................

A. ampersand symbol (&)
B. b. two Slashes (//)
C. number Sign (#)
D. less than symbol (<)
Answer» D. less than symbol (<)
1079.

Which of the following is the boolean operator for logical-and?

A. &
B. &&
C. |
D. |&
Answer» C. |
1080.

Which of the following is the correct operator to compare two variables?

A. :=
B. v
C. equal
D. = =
Answer» E.
1081.

Which of the following is not a correct variable type?

A. float
B. real.
C. switch
D. double
Answer» D. double
1082.

The pure virtual function represents the ..................

A. inheritance
B. overloading
C. overriding
D. interface
Answer» E.
1083.

A class that is inherited is called as .............. class.

A. derived
B. child
C. base
D. abstract
Answer» D. abstract
1084.

The specific version of the generic function created by the compiler is called as ...............

A. specialization
B. generalization
C. general function
D. template function
Answer» B. generalization
1085.

One of the methods to stop the execution of the function is by calling the standard .................. function.

A. goto
B. jump
C. stop
D. exit
Answer» E.
1086.

A ................ function is a function that has no body inside its base class.

A. inline
B. friend
C. constructor
D. pure virtual
Answer» E.
1087.

For a binary member operator function, the left operand is passed through ...............

A. pointer
B. reference
C. this
D. parameter
Answer» D. parameter
1088.

The data members of ................. share the same memory.

A. union
B. structure
C. function
D. class
Answer» B. structure
1089.

The .................. is a relationship.

A. polymorphism
B. inheritance
C. overloading
D. overriding
Answer» C. overloading
1090.

A derived class ....................

A. inherits data members and member functions from base class.
B. inherits constructors and destructor.
C. object can access protected members with the dot operator.
D. inherits data members and member functions from base class as well as Inherits constructors and destructor.
Answer» E.
1091.

Which of the following gives the value stored at the address pointed to by the pointer a?

A. a;
B. val(a);
C. *a;
D. &a;
Answer» D. &a;
1092.

Which of the following gives the memory address of a variable pointed to a pointer a?

A. *a;
B. a;
C. &a;
D. address(a);
Answer» B. a;
1093.

Which of the following gives the memory address of integer variable a?

A. *a;
B. a;
C. &a;
D. address(a);
Answer» D. address(a);
1094.

Which of the following is the proper declaration of a pointer?

A. int x;
B. int &x;
C. ptr x;
D. int *x;
Answer» E.
1095.

Find the invalid identifiers from the following:- (i) nA (ii) 2nd (iii) ROLL NO (iv) case

A. (i), (ii) and (iv)
B. (i) and (iii)
C. (ii), (iii) and (iv)
D. (ii), (i) and (iii)
Answer» D. (ii), (i) and (iii)
1096.

A generic function is also called as ..............

A. friend function
B. template function
C. virtual function
D. special function
Answer» C. virtual function
1097.

A generic function is created using the keyword ..................

A. template
B. generic
C. friend
D. class
Answer» B. generic
1098.

How many times the following code prints the string “hello”. for(i=1; i

A. 1
B. 1000
C. Zero
D. Syntax error
Answer» B. 1000
1099.

A structure defines a .................. type.

A. class
B. pointer
C. arrays
D. variables
Answer» B. pointer
1100.

The ................... member variable cannot have an initializer.

A. static
B. non-static
C. auto
D. register
Answer» C. auto