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.

What will be the output of the following program?void main(){ int x=300*400/300; printf("%d",x);}

A. 300
B. None of these
C. 400
D. 100
Answer» D. 100
2.

Trace the output.void main(){ printf("%d",-5%3);}

A. 1
B. 2
C. -2
D. 2.5
Answer» D. 2.5
3.

Trace the output.void main(){ int x=10,y=20; x=!x; y=!y; printf("x=%d , y=%d",x,y); }

A. x= -10 , y= -20;
B. x= 10 , y= 20;
C. x=0 , y=0;
D. None of the above.
Answer» D. None of the above.
4.

Trace the output.void main(){ int x=-5,y,num=5; y=x%-4; y=(y?0:num*num); printf("%d",y); }

A. 0
B. 25
C. -25
D. None of the above.
Answer» B. 25
5.

Which of the following operation can be applied to pointer variable?

A. Multiplication
B. Division.
C. Addition.
D. All of the above.
Answer» D. All of the above.
6.

Trace the output.#define no 5+3int main(){int result;result=no*no*no;printf("%d",result); return 0;}

A. 512
B. 38
C. Compile time error.
D. None of the above
Answer» C. Compile time error.
7.

Trace the output.int main(){int a=5;printf("%d %d %d", a ,a++, ++a); return 0;}

A. 5, 6, 7
B. 7, 6, 6
C. 5, 6, 6
D. None of the above.
Answer» C. 5, 6, 6
8.

What is keywords in c?

A. keywords have predefined meanings and user can change its value at compile time.
B. keywords have predefined meanings and cannot be changed.
C. There is no predefined value of keywords. User provides these values at runtime only.
D. None of the above.
Answer» C. There is no predefined value of keywords. User provides these values at runtime only.
9.

What would be the equivalent pointer expression for referring the array?arr[p][q][r][m]

A. * (*(*(*(arr+p)+q)+r)+m)
B. arr[0];
C. *((((arr+p)+q)+r)+m)
D. None of the above.
Answer» B. arr[0];
10.

Trace the output.int main(){char *str="careerride";printf("%d",printf("%s",str));return 0;}

A. 10careerride
B. careerride
C. careerride10
D. Compile time error.
Answer» D. Compile time error.
11.

The C language is.

A. A context sensitive language
B. A regular language
C. A context free language
D. None of the above.
Answer» D. None of the above.
12.

Which of the following is correct about structure in c++?

A. structure does not support inheritance but class supports.
B. class data members are private by default while structures are public by default.
C. structure cannot be declared as abstract.
D. All of the above.
Answer» E.
13.

Which of the following does not represent a valid storage class in c?

A. static
B. union
C. extern
D. automatic
Answer» C. extern
14.

Trace the output.int main(){int i = 5;int *j;int **k;j=&i;k=&j;printf("%u %u %d ",k,*k,**k);return 0;}

A. some address, some address, 5
B. some address, 5, 5
C. 5 , 5 , 5
D. None of the above.
Answer» B. some address, 5, 5
15.

Trace the outputvoid main(){ register R=20;int * P=&R;printf( %d , *P);}

A. some address.
B. 20
C. Compile time error.
D. None of the above.
Answer» D. None of the above.
16.

A pointer in c which has not been initialized is known as

A. far pointer
B. void pointer
C. null pointer
D. wild pointer
Answer» E.
17.

Trace the output.extern int P void main(){printf( %d , P);}

A. Error
B. 0
C. P
D. None of the above
Answer» B. 0
18.

Which of the following statement is are correct?

A. Default initial value of static integral type variables is zero.
B. A same static variable can be declared many times but we can initialize at only one time.
C. Option A and B are correct.
D. None of the above.
Answer» D. None of the above.
19.

C programming:main() { int x; if ( x > 4) printf( Brinda ); else if ( x > 10) printf( Karthik ); else if ( x > 21 ) printf( Pradeep ); else printf( Sandeep ); }What will be the value of x so that Karthik will be printed?

A. From 10 to 21
B. From 11 to 21
C. Grater then 10
D. None
Answer» E.
20.

C programming: To use the function tolower(), which of the following header file should be used

A. string.h
B. conio.h
C. ctype.h
D. None of the mentioned
Answer» D. None of the mentioned
21.

C programming: The compiler will give an error if we attempt to get the address of a variable with _________ storage class.

A. register keyword
B. extern keyword
C. static keyword
D. auto keyword
Answer» B. extern keyword
22.

C Programming: Queue can be used to implement

A. Radix sort
B. Quick sort
C. Recursion
D. Depth first search
Answer» B. Quick sort
23.

C programming: Which of the following is TRUE about argv?

A. It is an array of character pointers
B. It is a pointer to an array of character pointers
C. It is an array of strings
D. None of above
Answer» B. It is a pointer to an array of character pointers
24.

C programming: Which is not a storage class?

A. Auto
B. Struct
C. Typedef
D. Static
Answer» C. Typedef
25.

C programming: Which header file should be included to use functions like malloc() and calloc()?

A. memory.h
B. stdlib.h
C. string.h
D. dos.h
Answer» C. string.h
26.

C programming:What function should be used to free the memory allocated by calloc() ?

A. dealloc();
B. malloc(variable_name, 0)
C. free();
D. memalloc(variable_name, 0)
Answer» D. memalloc(variable_name, 0)
27.

What is the purpose of fflush() function? (C programming)

A. flushes all streams and specified streams.
B. flushes only specified stream.
C. flushes input/output buffer.
D. flushes file buffer.
Answer» B. flushes only specified stream.
28.

What would be the output of the following program? (C programming) #include stdio.h main(){int a, b=5;a=b+NULL;printf( %d , a);}

A. 6
B. 5
C. 5 5
D. None
Answer» C. 5 5
29.

How can one convert numbers to strings? (C programming)

A. Using atoi()
B. Using printf()
C. Using sprint()
D. Using nsprintf()
Answer» D. Using nsprintf()
30.

A transparent DBMS? (Database)

A. Can not hide sensitive information from users
B. Keep its logical structure hidden from users
C. Keeps its physical structure hidden from users
D. Both B and C
Answer» D. Both B and C
31.

The function that calls itself for its processing is known as.(C programming)

A. Inline Function
B. Nested Function
C. Overloaded Function
D. Recursive Function
Answer» E.
32.

In c programming a function can return ___________

A. Single value
B. Double value
C. Many value
D. all of the above
Answer» B. Double value
33.

Array index always start from (C programming)

A. 0
B. 1
C. 2
D. 3
Answer» B. 1
34.

C: Trace the outputint main(){char c[]="CAREERRIDE";char *p=c;printf ("%s",p+p[3]-p[1]);return 0;}

A. CAREERRIDE
B. ERRIDE
C. REERRIDE
D. None of the above.
Answer» C. REERRIDE
35.

C programming: The default parameter passing mechanism is called as

A. function call
B. call by value.
C. call by reference.
D. None of the above.
Answer» C. call by reference.
36.

C programming:The given expressionP = Q+1 is same as

A. P=P Q 1
B. P=P Q + 1
C. P= P + Q + 1
D. None of the above.
Answer» B. P=P Q + 1
37.

C programming : Trace the outputWhile( %d , printf( abc )){Printf( de );}

A. abcdeabcdeabcde
B. abdededede
C. Compile error.
D. None of the above.
Answer» B. abdededede
38.

C Programming :Trace the outputint main(){int x;for(x=1;x

A. 1 2 3 4 5 6 7 8 9 10
B. 10
C. 11
D. None of the above.
Answer» D. None of the above.
39.

Which operation can be applied to pointer variable?

A. Multiplication
B. Division.
C. Addition.
D. All of the above.
Answer» D. All of the above.
40.

What is size of void pointer?

A. 3
B. 9
C. 10
D. Platform dependent value
Answer» E.
41.

C Programming : Find the output#include< stdio.h>void i(int *a,int *b){a=b;*a=2;}int x=0,y=1;int main(){i(&x,&y);printf( %d%d n ,x,y);return 0; }

A. 22
B. 21
C. 02
D. 01
Answer» D. 01
42.

What is a null pointer?

A. Null pointer is a pointer which is pointing to nothing
B. Null pointer points the base address of segment
C. Pointer which is initialized with NULL value is considered as NULL pointer.
D. All of the above
Answer» E.
43.

C Programming : Consider the following programint n(int i){ static int a=0;if(i3){a=i;return n(i-2)+2;}return n (i-1)+a;}What is the value of f(5)?

A. 5
B. 10
C. 12
D. 18
Answer» E.
44.

See the following C declarationstruct v{ int n;float a;}struct v * x[10];Define x as

A. An array which has the same name as a program name
B. A structure with 10 elments in it
C. An array, where each element is a pointer to a structure of type node
D. A structure of 3 fields and an array of 10 elements
Answer» D. A structure of 3 fields and an array of 10 elements
45.

C programming : Trace the outputint main(){int a=12,b=39;printf ("%d",a&b);return 0;}

A. 468
B. 0
C. 4
D. None of the above.
Answer» D. None of the above.
46.

C programming : Suppose that x is a one dimensional array, then choose the correct answer regarding array.

A. *(x + n) is same as &x[n]
B. *&x[n] is same as x + n
C. *(x + n) is same as x[n] +1
D. *(x + n) is same as *x[n]
Answer» B. *&x[n] is same as x + n
47.

C programming : If you want to store dissimilar data together, then which type you will use?

A. array
B. structure
C. stack
D. None of the above.
Answer» C. stack
48.

C programming : Trace the output.void main(){int i=2,j=2;while(i+1?--i:j++)printf("%d",i);}

A. 1
B. 2
C. ERROR
D. None of the above.
Answer» B. 2
49.

C programming : Match the following:a. calloc( )------- i. Frees previouslyallocated space.b. free( ) ----------- ii. Modifiespreviouslyallocated space.c. malloc( ) ------- iii. Allocates spacefor array.d. realloc( ) ------- iv. Allocatesrequested size ofspace.

A. a-iii, b-i, c iv, d -ii
B. a-iii, b-ii, c i, d -iv
C. a-iii, b-iv, c i, d -ii
D. a-iv, b-ii, c iii, d -i
Answer» B. a-iii, b-ii, c i, d -iv
50.

Identify the wrong syntax(C programming)

A. typedef struct { member declaration; } NAME; NAME V1, V2;
B. typedef struct tag{ member declaration; } NAME; NAME V1, V2;
C. typedef struct { member declaration; } NAME; NAME V1, V2;
D. typedef struct tag { member declaration; } NAME; NAME V1, V2;
Answer» E.
Previous Next