You are on page 1of 5

Technical Written Test Theatro Labs

Name: Mobile:

Have you done any testing course?

1. Determine the output

void main()

int const *p=5;

printf("%d", ++(*p));

A. 6 B. 5

C. Garbage Value D. Compiler Error

2. For 16-bit compiler allowable range for signed integer constants is ________?

A. -3.4e38 to 3.4e38 B. -32767 to 32768

C. -32668 to 32667 D. -32768 to 32767

3. Which of the following services use TCP?

1. DHCP

2. SMTP

3. HTTP

4. TFTP

5. FTP

A. 1 and 2 B. 2, 3 and 5 C. 1, 2 and 4 D. 1, 3 and 4

4. Suppose a class has public visibility. In this class we define a protected method. Which of the
following statements is correct?

A. This method is only accessible from inside the class itself and from inside all subclasses.

B. In a class, you cannot declare methods with a lower visibility than the visibility of the class in
which it is defined.

1
C. From within protected methods you do not have access to public methods.

D. This method is accessible from within the class itself and from within all classes defined in the
same package as the class itself.

5. C preprocessor

A. Takes care of conditional compilation

B. Takes care of macros

C. Takes care of include files

D. Acts before compilation

E. All of the above

6. What will happen after compiling and running following code?

main()

printf("%p", main);

A. Error B. Will make an infinite loop.

C. Some address will be printed. D. None of these.

7. int x = 0, y = 0 , z = 0 ;

x = (++x + y-- ) * z++;

What will be the value of "x" after execution ?

A. -2 B. -1

C. 0 D. 1

8. Choose the best answer.

Prior to using a pointer variable

A. It should be declared. B. It should be initialized.

C. It should be both declared and initialized. D. None of these.

9. Comment on the following pointer declaration?

int *ptr, p;

2
A. ptr is a pointer to integer, p is not.

B. ptr and p, both are pointers to integer.

C. ptr is pointer to integer, p may or may not be.

D. ptr and p both are not pointers to integer.

10. Which command is used to display the characteristics of a process?

A. pid B. du

C. ps D. au

11. What will be the return type of a method that not returns any value?

A. void B. int

C. double D. None of the above

12. What is right way to Initialize array?

A. int num[6] = { 2, 4, 12, 5, 45, 5 }; B. int n{} = { 2, 4, 12, 5, 45, 5 };

C. int n{6} = { 2, 4, 12 }; D. int n(6) = { 2, 4, 12, 5, 45, 5 };

13. Exception generated in try block is caught in ........... block.

A. catch B. throw

C. throws D. finally

14. void main()

int c = - -2;

Printf ("c=%d", c);

A. 1 B. -2

C. compilation error D. 2

15. Which of following is not a valid name for a C variable?

A. Theatro B. Thea_tro

C. Theatro theatro D. Both A and B

3
16. Any C program

A. Must contain at least one function.

B. Need not contain any function.

C. Needs input data.

D. None of the above

17. What will be the output of the program?

#include<stdio.h>

void main()

printf(5+"Good Morning\n");

A. Good Morning B. Compilation error

C. Good D. Morning

18. An array elements are always stored in ________ memory locations.

A. Sequential

B. Random

C. Sequential and Random

D. None of the above

19. Which of the following comments about the ++ operator are correct?

A. It is a unary operator B. The operand can come before or after the operator

C. It cannot be applied to an expression D. It associates from the right

E. All of the above

20. What is the output of given program if user enter value 99?

#include<stdio.h>

void main()

int i;

4
printf("Enter a number:");

scanf("%d", &i); // 99 is given as input.

if(i%5 == 0){

printf("\n Number entered is divisible by 5");

A. Enter a number:

B. Enter a number:99 Number is divisible by 5

C. complier error

D. Run time error

You might also like