Explore topic-wise MCQs in Testing Subject.

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

1.

Prime area in context of file system is defined as ...............

A. a memory area created by operating system
B. an area into which data records are written
C. the main area of a web page
D. primary memory
Answer» C. the main area of a web page
2.

Choose the correct one

A. Address operator cannot be applied to register variables
B. Address operator can be applied to register variables
C. Use of register declaration will increase the execution time
D. None of the above
Answer» E.
3.

The constructed datatype of C is known as

A. Pointers
B. String
C. Structure
D. Array
Answer» D. Array
4.

The function used to read a character from a file that has been opened in read mode is

A. putc
B. getc
C. getchar
D. putchar
Answer» C. getchar
5.

The operands converted up to the type of largest operands are called .............

A. integral promotion
B. type promotion
C. value promotion
D. cast
Answer» C. value promotion
6.

The automatic conversion of all char and short int values to int is called ...............

A. integral promotion
B. type promotion
C. value promotion
D. cast
Answer» B. type promotion
7.

The ............. storage class is the only request to the compiler.

A. extern
B. static
C. register
D. auto
Answer» D. auto
8.

To declare an array S that holds a 5-character string, you would write

A. char S[5]
B. String S[5]
C. char S[6]
D. String S[6]
Answer» B. String S[5]
9.

What is the output of following program:- int q, *p, n; q = 176; If the address of q is 2801 p = &q; and p is 2600 n = *p; printf(“%d”, n);

A. 2801
B. 176
C. 2600
D. None of the above
Answer» C. 2600
10.

The output of the following is x = ‘a’; printf(“%d”, x);

A. ‘a’
B. a
C. 97
D. None of the above
Answer» D. None of the above
11.

An inverted file is a file ..................

A. that locates information about data in small files that are maintained apart from actual data record
B. which stores opposite records
C. which stores information about records of a system
D. which stores data
Answer» B. which stores opposite records
12.

Which of the following is not an advantage of secondary memory?

A. It is cost-effective
B. It has large storage capacity
C. It has highest speed
D. It is easily portable
Answer» D. It is easily portable
13.

A direct access file is ..................

A. a file in which records are arranged in a way they are inserted in a file
B. a file in which records are arranged in a particular order
C. a file which is stored on a direct access storage medium
D. none of the above
Answer» D. none of the above
14.

Minimum number of temporary variable needed to swap the contents of 2 variables is ...................

A. 1
B. 4
C. 2
D. 0
Answer» E.
15.

The eof() is the function used for .............

A. asserting no errors in a file
B. appending data to a file
C. counting the amount of data in a file
D. checking for end of file
Answer» E.
16.

Which of the following correctly describes the meaning of namespace feature in C++?

A. Namespaces refer to the memory space allocated for names used in a program
B. Namespaces refer to space between the names in a program
C. Namespaces refer to space between the names in a program
D. Namespaces provide facilities for organizing the names in a program to avoid name clashes
Answer» E.
17.

Which header file should we include for using std::auto_ptr?

A. <memory>
B. <alloc>
C. <autoptr>
D. <smartptr>
Answer» B. <alloc>
18.

When is std::bad_alloc ex

A. When new operator cannot allocate memory
B. When alloc function fails
C. When type requested for new operation is considered bad, this exception is thrown
D. When delete operator cannot delete teh allocated (corrupted) object
Answer» B. When alloc function fails
19.

Determine which of the following is an invalid character constant.

A. ‘a’
B. ‘T’
C. ‘0’
D. ‘/n’
Answer» E.
20.

Consider the following statements: x = 5; y = x >3 ? 10 : 20; The value of y is

A. 10
B. 20
C. 5
D. 3
Answer» B. 20
21.

How do we declare an abstract class?

A. By providing at least one pure virtual method in a class
B. By declaring at least one method abstract using the keyword abstract in a class
C. By declaring the class abstract with the keyword abstract
D. By declaring the class abstract with the keyword abstract
Answer» B. By declaring at least one method abstract using the keyword abstract in a class
22.

Which of the following operators can be overloaded?

A. .(dot or member access operator)
B. & (address-of operator)
C. sizeof operator
D. ?: (conditional operator)
Answer» C. sizeof operator
23.

Which of the following operator cannot be overloaded?

A. = (assignment operator)
B. == (equality operator)
C. -> (rrow operator)
D. :: (cope resolution operator)
Answer» E.
24.

If X is the name of the class, what is the correct way to declare copy constructor of X?

A. X(X arg)
B. X(X* arg)
C. X(const X* arg)
D. X(const X& arg)
Answer» E.
25.

What is the implicit pointer that is passed as the first argument for non-static member functions?

A. self pointer
B. std::auto_ptr pointer
C. Myself pointer
D. this pointer
Answer» E.
26.

Which of the following is the most common way of implementing C++?

A. C++ programs are directly compiled into native code by a compiler
B. C++ programs are first compiled to intermediate code by a compiler and then executed by a virtual machine
C. C++ programs are interpreted by an interpreter
D. A C++ editor directly compiles and executes the program
Answer» B. C++ programs are first compiled to intermediate code by a compiler and then executed by a virtual machine
27.

What is the full form of STL in C/C++?

A. Simple Template Library
B. Standard Template Library
C. Static Type Library
D. Single Type-based Library
Answer» C. Static Type Library
28.

Which of the following language feature is not an access specifier in C++?

A. Public
B. Private
C. Protected
D. internal
Answer» E.
29.

Which of the following concept is not supported by C++?

A. Exception Handling
B. Reflection
C. Operator Overloading
D. Namespaces
Answer» C. Operator Overloading
30.

Which of the following keyword supports dynamic method resolution?

A. Abstract
B. Virtual
C. Dynamic
D. Typeid
Answer» C. Dynamic
31.

Which of the following correctly describes C++ language?

A. Statically typed language
B. Dynamically typed language
C. Both Statically and dynamically typed language
D. Type-less language
Answer» B. Dynamically typed language
32.

Which of the following language is a subset of C++ language?

A. C language
B. Java Language
C. C# language
D. B language
Answer» B. Java Language
33.

A single character input from the keyboard can be obtained by using the function.

A. printf ()
B. scanf ()
C. putchar ()
D. getchar ()
Answer» E.
34.

What is the output of the following statement: printf (“%-3d”,12345);

A. 1 2 3
B. -1 2 3
C. 1 2 3 4 5
D. 12
Answer» D. 12
35.

The first digit of a decimal constant must be

A. a zero
B. a non zero number
C. a negative number
D. an integer
Answer» E.
36.

Which of the following header files is required for creating and reading data files?

A. ofstream.h
B. fstream.h
C. ifstream.h
D. console.h
Answer» C. ifstream.h
37.

Which type of data file is analogous to an audio cassette tape?

A. random access file
B. sequential access file
C. binary file
D. source code file
Answer» C. binary file
38.

The rand() built-in library function ................

A. is a true random number generator
B. returns positive double values
C. is a pseudo-random number generator
D. returns a different sequence of values each time it is run
Answer» D. returns a different sequence of values each time it is run
39.

Time_t is a .................

A. variable used to hold a number from the computers internal clock
B. data type
C. built-in library function which will return a value from the internal clock
D. header file
Answer» C. built-in library function which will return a value from the internal clock
40.

To raise any number to a power, ................ is used.

A. the exponent symbol ^
B. the built-in library function pow(x,y)
C. the built-in library function pow10(x)
D. concatenation
Answer» C. the built-in library function pow10(x)
41.

The built-in library function ceil(x) requires the ................... header file.

A. <ctype.h>
B. <math.h>
C. <stdlib.h>
D. <time.h>
Answer» C. <stdlib.h>
42.

The built-in library function isalnum( ) is testing to determine if the argument is ...............

A. one of "all" numbers available from the keyboard
B. an alphabet character
C. an ASCII character
D. an alphanumeric
Answer» E.
43.

printf(“%–10s”, “ABDUL”); displays

A. ABDULbbbbb
B. bbbbbABDUL
C. ABDULbbbbbbbbbb
D. bbbbbbbbbbABDUL
Answer» B. bbbbbABDUL
44.

puts(argv[0]);

A. prints the name of the source code file.
B. prints argv.
C. prints the number of command line arguments.
D. prints the name of the executable code file.
Answer» E.
45.

What is the output of following statement? for(i=1; i

A. 1 4 3
B. 1 2 3
C. 2 4 6
D. 2 2 6
Answer» B. 1 2 3
46.

Which of the following is not a looping statement in C?

A. while
B. Until
C. do
D. for
Answer» C. do
47.

What is the following function computing? Assume a and b are positive integers. int fn( int a, int b) { if (b == 0) return b; else return (a * fn(a, b - 1)); }

A. Output will be 0 always
B. Output will always be b
C. Computing ab
D. Computing a + b
Answer» B. Output will always be b
48.

Which of the following is not true with the reference variable?

A. References eliminate the overhead associated with passing large data structures as parameters.
B. It cannot be used to reduce complex notation.
C. References eliminate pointer dereference notation.
D. It is a copy alias for another variable.
Answer» C. References eliminate pointer dereference notation.
49.

When a function returns a reference it ...................

A. returns an implicit pointer to its return value
B. displays that pointer
C. returns the value referring to it
D. does not return anything
Answer» B. displays that pointer
50.

A global variable is a variable

A. declared in the main ( ) function
B. declared in any function other than the main ( ) function.
C. declared outside the body of every function.
D. declared any where in the C program.
Answer» D. declared any where in the C program.