Computer Programming (C/C++)

1 Which of the following is/are storage class
A. Automatic
B. Static
C. Allocated
D. All of Above

2 What will the output of following code
{ int x
=
10, y
=
15;
x = x++;
y = ++y;
printf(“%d, %d \n”, x, y);
}
A. 10, 15
B. 10, 16
C. 11, 16
D. 11, 15

3 NULL Pointer can be used as
A. To stop indirection in a recursive data structure
B. As an error value
C. As a sentinel Value
D. All of Above

4 Which one of the following is not the advantages of functions?
A. Debugging is easier
B. Testing is easier
C. Recursive call is possible
D. It consumes low disk space

5 What is the result of the following statement?
x = y = z = 0;
A. x = 0, y = Null, z = Null
B. x = 0, y = 0, z = 0
C. x = 0, y = 1, z = 2
D. the statement is incorrect

6 What is the result of the following statement?
X = 10;
y = ++x;
A. x = 10, y = 10
B. x = 10, y = 11
C. x = 11, y = 10
D. x = 11, y = 11

7 Which of the following statement creates infinite loop?
A. for ( ; ; )
B. while ( ; ; )
C. when ( ; ; )
D. if( ; ; )

8 The use of “break” Statement
A. to terminate a case in the switch statement
B. to force immediate termination of a loop
C. Both A & B
D. Only A

9 to use the function tolower(), which of the following header file should include
A. string.h
B. conio.h
C. ctype.h
D. Don’t need any header file

10 What is the function overloading?

A. Calling a function from another function
B. Having more than one functions of same name
C. Calling a function from itself
D. There is no such term in C/C++


Answers
1 – D / 2 – C / 3 – D / 4 – D / 5 – B / 6 – D / 7 – A / 8 – C / 9 – C / 10 – B


Comments

Popular posts from this blog

Electrical Machines (Three Phase Transformers)

Thermodynamics (Compressible Flow)

Electrical Machines (Special Machines)