3_2_Interview Questions

CONSOLE IO OPERATIONS

Multiple Choice Questions

10. Which of the following defines the correct functionality of getch()?

 a) read character instantly without displaying it

 b) assign character instantly without pressing enter key

 c) display character followed by enter key

 d) Both A & B

11. The function of gets() is to read _______from the standard input and store it in char array.

 a) The string of characters including new line character

 b) The array of strings including new line character

 c) The string of characters excluding new line character

 d) The array of strings excluding new line character

12. What is the functionality of puts()?

 a) Store the string of character to char array

 b) Write the string of character on o/p screen

 c) Read a single character

 d) Read string of character

13. Statement 1: Gets function assign string to char array;
Statement 2: Puts function receive array of string.

 a) Statement 1 is True; Statement 2 is True;

 b) Statement 1 is True; Statement 2 is False;

 c) Statement 1 is False; Statement 2 is True;

 d) Statement 1 is False; Statement 2 is False;

14. What will be the output of the program
main()
{
float f=98.7754;
printf(“%7.2f”, f);
}

 a) 98.78

 b) 0098.77

 c) 98.7754

 d) 98.0077

15. Match the pair-
Function      Functionality
1. getchar()   a) Write a single character
2. gets()       b) Write the string character
3. puts()       c) Read a single character
4. putchar()   d) Read the string character