< Back To C Tests

C (Basic Test 2)

1. Which of the following function reads a character only one at a time from terminal and return it as an integer?

gets()
getchar()
scanf()
getc()

2. Which of the following statement is true according to C syntax rule

All C instruction must be written in Upper case character
C is not a case sensitive language.
All C statement must end with a semicolon.
All of the above.

3. Which of the following is not a valid keyword in C language

case
register
native
typedef

4. The first character of an identifier in C langauge can contain ?

only alphabet( a-z , A-Z ) or underscore ( _ )
only numeric character(0-9)
only special character($, #, @)
all of the above

5. Which operator in C is used to return the size of a variable ?

size operator
sizeof operator
& operator
ternary operator

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

Compiler Error
Will make an infinite loop
Some address will be printed
Runtime Error

7. ________ variable is initialized only once and remains into existence till the end of program ?

external variable
static variable
automatic variable
register variable

8.

BreakInterview4
4BreakInterview
BreakInterview14
4

9. Predict the output of the following code.

“BREAK % INTERVIEW % QUIZ”
BREAK % INTERVIEW % QUIZ
\” BREAK %% INTERVIEW %% QUIZ\”
BREAK %% INTERVIEW %% QUIZ

10. Predict the output of the following code.

BreakInterview
Interview
1005
Compiler Error