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.

Which gcc flag is used to enable all Compiler warnings?

A. gcc -W
B. gcc -w
C. gcc -Wall
D. gcc -wall
Answer» D. gcc -wall
2.

Which macro is used to insert assembly code in C program (GCC compiler)?

A. __asm__
B. _asm_
C. __asm
D. asm
Answer» B. _asm_
3.

Address stored in the pointer variable is of type __________.

A. Integer
B. Array
C. Floating
D. Character
Answer» B. Array
4.

To print a single character in ouptut,which function is used?

A. getchar()
B. gets()
C. putchar()
D. puts()
Answer» D. puts()
5.

Pointer is special kind of variable which is used to store __________ of the variable.

A. Address
B. Value
C. Variable Name
D. Data Type
Answer» B. Value
6.

Which Of The Following Shows The Correct Hierarchy Of Arithmetic Operations In C

A. / + * -
B. * - / +
C. + - / *
D. * / + -
Answer» E.
7.

Array which is having ____ dimensions is called as 2-D array.

A. 3
B. 2
C. 5
D. 4
Answer» C. 5
8.

Array can be considered as set of elements stored in consecutive memory locations but having __________.

A. Same Data Type
B. Same Scope
C. None of these
D. Different Data Type
Answer» B. Same Scope
9.

Smallest element of an array is called as _______.

A. Middle Bound
B. Range
C. Upper Bound
D. Lower Bound
Answer» E.
10.

A Pointer to a block of memory is considered same as an array.

A. NO
B. YES
C. none
D. all
Answer» C. none
11.

What is the extension of output file produced by Preprocessor?

A. .h
B. .exe
C. .i
D. .asm
Answer» D. .asm
12.

What is maximum dimension that array can have in c programming?

A. 2
B. 4
C. Theoretically No Limit but practically limit depends on memory
D. 3
Answer» D. 3
13.

Array is ______ data type in C Programming language.

A. Custom Data Type
B. Primitive Data Type
C. None of these
D. Derived Data Type
Answer» E.
14.

In Array, There is one to one correspondence between set of ________ and set of values.

A. Indices
B. Variables
C. Constants
D. Memory Locations
Answer» B. Variables
15.

Array with last element 'n' will always have array size equal to _______.

A. n+1
B. n-1
C. n+n
D. n
Answer» B. n-1
16.

Which Of The Following Is Executed By Preprocess?

A. #Include<Stdio.H>
B. Return 0
C. Void Main(Int Argc , Char ** Argv)
D. none
Answer» B. Return 0
17.

What is the following is invalid header file in C?

A. math.h
B. mathio.h
C. string.h
D. ctype.h
Answer» C. string.h
18.

Which one of the following is invalid macro in C programming?

A. #pragma
B. #error
C. #ifndef
D. #elseif
Answer» E.
19.

If we have declared an array described below int arr[6]; then which of the following array element is considered as last array element ?

A. arr[6]
B. arr[4]
C. arr[0]
D. arr[5]
Answer» E.
20.

What is output of below program?int main(){for(; ;);for(; ;);printf("Hello");return 0;}

A. Compilation Error
B. Runtime Error
C. Nothing is printed
D. Hello is printed infinite times
Answer» D. Hello is printed infinite times
21.

What is the output of below program?int main(){for(; ;)for(; ;)printf("Hello..");return 0;}

A. Compilation Error
B. Runtime Error
C. Hello is printed one time
D. Hello is printed infinite times
Answer» E.
22.

What is output of below program?int main(){int i,j,k,count;count=0;for(i=0;i

A. 5
B. 10
C. 25
D. 50
Answer» D. 50
23.

What is output of below program?int main(){int i,j,count;count=0;for(i=0; i

A. 55
B. 54
C. 1
D. 0
Answer» D. 0
24.

What is output of below program?int main(){int i;for(i=0; i

A. Hello is printed 5 times
B. Compilation Error
C. Hello is printed 2 times
D. Hello is printed 3 times
Answer» C. Hello is printed 2 times
25.

What is output of below program?int main(){int i,j;for(i = 0,j=0;i

A. 0--01--12--23--34--
B. 00--10--20--30--40--
C. Compilation Error
D. 00--01--02--03--04--
Answer» C. Compilation Error
26.

#include "stdio.h"int main(){int = 10;printf("%d", );return 0;}

A. 10
B.
C. @[Error] stray '@' in program
Answer» E.
27.

What should be the output of below program?#define # include "stdio.h"int main(){printf("C.com");return 0;}

A. C.com
B. Nothing
C. Compilation Error
D. Depends on Complier
Answer» D. Depends on Complier
28.

How many times C.com is printed?int main(){int a = 0;while(a++)printf("C.com");return 0;}

A. 1 time
B. 0 time
C. Infinite times(Untill Stack is overflow)
D. 2 times
Answer» C. Infinite times(Untill Stack is overflow)
29.

How many times C.com is printed?int main(){int a = 0;while(a++ < 5)printf("C.com");return 0;}

A. 5 times
B. 4 times
C. 3 times
D. 1 times
Answer» B. 4 times
30.

How many times C.com is printed?int main(){int a = 0;while(++a){printf("C.com");}return 0;}

A. 1 time
B. Infinite Times(Untill Stack is overflow)
C. 2 times
D. Error
Answer» C. 2 times
31.

#include "stdio.h"int a = 20;int main(){int a = 10;printf("%d", ::a);return 0;}

A. 10
B. 20
C. ::20
D. ::10
Answer» C. ::20
32.

int main(){int x;x=10,20,30;printf("%d",x);return 0;}

A. 10
B. 20
C. 30
D. Compilation Error
Answer» B. 20
33.

How many times C.com is printed?int main(){int a = 0;while(a++ < 5-++a)printf("C.com");return 0;}

A. 5 times
B. 4 times
C. 3 times
D. 1 times
Answer» E.
34.

Int Main(){Int A = 5;Int B = 10;Int C = A+B;Printf("%I",C);

A. 0
B. 15
C. Undefined I
D. Any Other Compiler Error
Answer» C. Undefined I
35.

which of the following is the best for getting a string with space from the standard input

A. gets
B. getc
C. fgets
D. puts
Answer» D. puts
36.

Which statement is used to compare the two strings?

A. strcmp
B. strcompare
C. stringcompare
D. str_cmp
Answer» B. strcompare
37.

void main(){printf();}

A. Run-Time Error
B. Compile-Time Error
C. none
D. all
Answer» C. none