OOPS interview questions
93 questions. Tap “Show answer” to check yourself.
-
The storage class controls
- Scope of a variable
- Life time of a variable
- Both a and b
- None of above
Show answer
C. Both a and b
-
Which of the following is not a valid reason for using functions?
- They use less memory than repeating the same code.
- They keep different program activities separate.
- They run faster.
- They keep variables safe from other parts of the program.
Show answer
C. They run faster.
-
The C language provides a way to access contents of a file from a program using
- System calls
- Library function
- Both a and b
- None of above
Show answer
B. Library function
-
The continue statement is used to
- Continue execution of the program error occurs.
- Exit from the outermost block even it is used in the innermost block.
- Exit the block of loop statement.
- Continue the next iteration of the loop statement.
Show answer
D. Continue the next iteration of the loop statement.
-
The operators exclusively used with pointers are
- * and /
- & and *
- & and ^
- * and +
Show answer
B. & and *
-
A structure is a data type in which
- Elements can be of different type.
- Each element must have the same type.
- Each element must be of pointer type.
- None of above
Show answer
A. Elements can be of different type.
-
Preprocessor does not which one of the following?
- Macro expansion
- Conditional compilation
- Loading include file
- Type checking
Show answer
A. Macro expansion
-
Which of the following statement is true about continue statement?
- It can be used in conjunction with switch statement.
- It terminates the loop.
- It terminates the current iteration.
- None of above
Show answer
C. It terminates the current iteration.
-
Union differs from structure in the following way
- Only one member can be used at a time.
- Unions cannot have more than two members.
- Union initializes all members as structure.
- All members are used at a time.
Show answer
A. Only one member can be used at a time.
-
Which of the following statement is true about register storage class?
- Variable always stored in processor registers.
- Can only be used with integral data types and pointers.
- Variable takes initial value 0 if not initialized.
- None of above
Show answer
B. Can only be used with integral data types and pointers.
-
Which of the following statement is a correct statement about typedef statement?
- It is used to define a function.
- It is used to re-define a existing or user defined data type.
- It is primitive data type.
- None of above
Show answer
B. It is used to re-define a existing or user defined data type.
-
Which of the following function will you use in case you want to provide the password facility in your program for security purposes?
- gets()
- scanf()
- getch()
- getchar()
Show answer
C. getch()
- Advertisement
-
Which of the following function can be used to write only integer numbers
- putw()
- fwrite()
- putint()
- fprintf()
Show answer
A. putw()
-
Which of the following statements is not true about floating point number to a string?
- ftoa()
- dtoa()
- gcvt()
- all of above
Show answer
C. gcvt()
-
A bit field is of type
- double
- float
- int
- all of the above
Show answer
C. int
-
The function ftell() returns
- the middle position of the file
- the current position of the file
- the end position of the file
- the beginning position of the file
Show answer
B. the current position of the file
-
Which of the following function can be used to read an entire array or a structure in a single call?
- readblock()
- READ()
- read()
- fread()
Show answer
D. fread()
-
Arrays are always passed as arguments to a function by
- depends on compiler optimization settings
- depends on the number of arguments
- value
- reference
Show answer
D. reference
-
The function that allows a file to read randomly is
- frandon()
- rewind()
- ftell()
- fseek()
Show answer
D. fseek()
-
Which of the following is not a control statement in C language?
- goto statement
- switch statement
- for statement
- repeat until statement
Show answer
D. repeat until statement
-
Which of the following modifier is used to declare a variable as constant?
- const
- signed
- short
- unsigned
Show answer
A. const
-
Which of the following string functions reverse the string?
- strrev()
- strcmp()
- strlen()
- strcpy()
Show answer
A. strrev()
-
Operand of indirection operator is
- ordinary variable
- integer constant
- pointer variable
- none of above
Show answer
C. pointer variable
-
Which of the following statements are true about break statement?
- The break statement terminates current iteration of the loop.
- The break statement can be used with if statement to terminate the execution of its block.
- The break statement can only be used with loop statements and switch statement.
- None of above
Show answer
C. The break statement can only be used with loop statements and switch statement.
- Advertisement
-
Which of the following input function cannot be used to input multiword string in a single function call?
- getche()
- gets()
- scanf()
- None of above
Show answer
A. getche()
-
Which of the following declarations is not correct?
- unsigned float d;
- unsigned char c;
- int b = 4;
- float a;
Show answer
A. unsigned float d;
-
Which of the following operators has highest precedence?
- *
- /
- %
- All have same precedence
Show answer
D. All have same precedence
-
What is the file extension for font files?
- txt
- bgi
- chr
- font
Show answer
C. chr
-
Which of the following function can be used to write an entire array or a structure in a single call?
- writeblock()
- write()
- fwrite()
- WRITE()
Show answer
C. fwrite()
-
File opening is a process of
- Writing data to a file
- Connecting program to a file
- Reading data from a file
- None of above
Show answer
B. Connecting program to a file