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.

The declaration void function1(int) indicates the function1 is a function which

A. Has no arguments
B. Returns nothing
C. Both (a) and (b)
D. None of these
Answer» C. Both (a) and (b)
2.

What is the format identifier for “static a = 20.5;”?

A. %s
B. %d
C. %f
D. Illegal declaration due to absence of data type
Answer» C. %f
3.

In a conditional inclusion, if the condition that comes after the if holds.

A. Then the code up to the following #else or #elif or #endif is compiled
B. Then the code up to the following #endif is compiled even if #else or #elif is present
C. Then the code up to the following #eliif is compiled
D. None of the mentioned
Answer» B. Then the code up to the following #endif is compiled even if #else or #elif is present
4.

Automatic variables are initialised to

A. Zero
B. Junk value
C. Nothing
D. Both Zero & Junk value
Answer» C. Nothing
5.

The function fprintf is used in a program

A. When too many printf calls have been alrady used in the program
B. In place of printf, since printf uses more memory
C. When output i to be printed on to a file
D. All of above
Answer» D. All of above
6.

Automatic variables are allocated space in the form of a:

A. stack
B. queue
C. priority queue
D. random
Answer» B. queue
7.

The scope of an automatic variable is:

A. Within the block it appears
B. Within the blocks of the block it appears
C. Until the end of program
D. Within the block it appears & Within the blocks of the block it appears
Answer» E.
8.

Default storage class if not any is specified for a local variable, is auto

A. true
B. false
C. Depends on the standard
D. None of the mentioned
Answer» B. false
9.

Register variables reside in

A. stack
B. registers
C. heap
D. main memory
Answer» C. heap
10.

What is the return-type of the function sqrt() ?

A. int
B. float
C. double
D. depends on the data type of the parameter
Answer» D. depends on the data type of the parameter
11.

How many type of conversion are there in C?

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

Automatic variables are variables that are

A. Declared within the scope of a block, usually a function
B. Declared outside all functions
C. Declared with auto keyword
D. Declared within the keyword extern
Answer» B. Declared outside all functions
13.

Pick the correct statements

A. The body of a function should have only one return statement
B. The body of a function may have many return statements
C. A function can return only one value to the calling environment
D. Both (b) & (c)
Answer» E.
14.

The variable declaration with no storage class specified is by default:

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

C preprocessor is conceptually the first step during compilation

A. true
B. false
C. Depends on the compiler
D. Depends on the standard
Answer» B. false
16.

Automatic variables are stored in

A. stack
B. data segment
C. register
D. heap
Answer» B. data segment
17.

Which of the following function calculates the square of 'x' in C?

A. sqr(x)
B. pow(2, x)
C. pow(x, 2)
D. power(2, x)
Answer» D. power(2, x)
18.

For each #if, #ifdef, and #ifndef directive

A. There are zero or more #elif directives
B. Zero or one #else directive
C. One matching #endif directive
D. All of the mentioned
Answer» E.
19.

Which of the following is not a primitive recursive but partially recursive?

A. Carnot's function
B. Ricmaan function
C. Both (a) and (b)
D. Ackermann's function
Answer» E.
20.

max is a function that returns the larger of the two integers, given as arguments. Which of the following statements finds the largest of three given numbers?

A. max (max (a, b), max (a, c))
B. max(b, max(a, c) )
C. max (max (a, b). max ( b, c ))
D. All of the above
Answer» E.
21.

What is the output of this C code? include void m() { printf("hi"); } void main() { m(); }

A. hi
B. Run time error
C. Nothing
D. Varies
Answer» B. Run time error
22.

What is the output of this C code?

A. Compile time error as foo is local to main
B. 1 2
C. 2 1
D. Compile time error due to declaration of functions inside main
Answer» C. 2 1
23.

Cos728° =

A. −cos8°
B. −sin8°
C. sin8°
D. cos8°
Answer» E.
24.

Sin5θcos2θ =

A. 1/2[sin7θ+sin3θ]
B. [sin7θ+sin3θ]
C. 1/2[sin7θ-sin3θ]
D. None of Above
Answer» B. [sin7θ+sin3θ]
25.

Sin(-625) =

A. −cos5°
B. cos5°
C. sin5°
D. −sin5°
Answer» C. sin5°
26.

Sin(A+45°)sin(A-45°) =

A. −1/2cos(2A)
B. −1/2sin(2A)
C. −1/2sin(2A)
D. None of Above
Answer» B. −1/2sin(2A)
27.

Cos(π+α) =

A. cosα
B. −cosα
C. −sinα
D. sinα
Answer» C. −sinα
28.

If tanθ < 0, sinθ < 0, then terminal arm of angle lies in quadrant

A. 1
B. 2
C. 3
D. 4
Answer» B. 2
29.

Cosθ + cosπ =

A. −2sin(θ + π/2)sin(θ-π/2)
B. −2sin(θ + π/2)sin(θ-π/2)
C. 2cos(θ + π/2)cos(θ-π/2)
D. None of Above
Answer» D. None of Above
30.

cotα-cotβ/1 + cotαcotβ

A. cos15°
B. cos15°
C. −sin15°
D. sin15°
Answer» E.
31.

Tan(α + β) =

A. tanα-tanβ/1 + tanαtanβ
B. tanα+tanβ/1 - tanαtanβ
C. cotα+cotβ/1-cotαcotβ
D. cotα-cotβ/1 + cotαcotβ
Answer» C. cotα+cotβ/1-cotαcotβ
32.

 Cos3α =

A. 4sinα - 3sin³α
B. 4cos³α - 3cosα
C. 3cos³α - 4cosα
D. 3cos³α - 4cosα
Answer» B. 4cos³α - 3cosα
33.

Period of cot(3x) is

A. π/3
B. π/2
C. 2π/3
D. π
Answer» B. π/2
34.

Domain of cscx is

A. [-1 1]
B. R
C. R-{x|x = (2n+1)π/2,nεZ}
D. R-{x|x = nπ,nεZ}
Answer» E.
35.

Period of 15sin(x/15) is

A. 30π
B. 15π
C. 10π
D.
Answer» B. 15π
36.

Period of 3sin(3x) is

A. π/3
B. π/2
C. 2π/3
D. π
Answer» D. π
37.

Period of cos(2x) is

A. π
B.
C.
D.
Answer» B. 2π
38.

Domain of cos(x) is

A. [-1 1]
B. R
C. R-{0}
D. R-{1}
Answer» C. R-{0}
39.

Period of tan(x/3) is

A. π
B.
C.
D. None of Above
Answer» D. None of Above
40.

Domain of cot(x) is

A. [-1 1]
B. R
C. R-{x|x = (2n+1)π/2,nεZ}
D. R-{x|x = nπ,nεZ}
Answer» E.
41.

 Period of 3cot(x/3) is

A. π
B.
C.
D.
Answer» D. 4π
42.

Range of cos(x) is

A. [-1 1]
B. R
C. R
D. R-{x|x = nπ,nεZ}
Answer» B. R
43.

Period of tan(2x) is

A. π/3
B. π/2
C. 2π/3
D.
Answer» C. 2π/3
44.

 Domain of tan(x) is

A. [-1 1]
B. R
C. R-{x|x = (2n+1)π/2,nεZ}
D. R-{x|x = nπ,nεZ}
Answer» D. R-{x|x = nπ,nεZ}
45.

 Period of cos(x) is

A. π
B.
C.
D.
Answer» C. 3π
46.

Range of tan(x) is

A. [-1 1]
B. R
C. R-{x|x = (2n+1)π/2,nεZ}
D. R-{x|x = nπ,nεZ}
Answer» C. R-{x|x = (2n+1)π/2,nεZ}
47.

Period of cos(3x) is

A. π/3
B. π/2
C. 2π/3
D. π
Answer» D. π
48.

Period of sec(x) is

A. π
B.
C.
D.
Answer» C. 3π
49.

Period of csc(x/3) is

A. π
B.
C.
D.
Answer» E.
50.

Period of csc(2x) is

A. π/3
B. π/2
C. 2π/3
D. π
Answer» D. π