12th Class Class Computer Mcqs Chapter No 10 | 2nd Year Computer Mcqs Chapter Wise Pdf

Print/Downlaod pdf

Chapter No 10

Input/Output

1. The function getch() is defined in choose which one is correct: 

  1. stdio.h
  2. string.h 
  3. math.h
  4. conio.h

2. The escape sequence for backslash is choose which one is correct:

  1.  \
  2.  \b 
  3. \\
  4.  \t 

3.          function is used to display output on screen choose which one is correct: 


  1. scanf()
  2. printf()
  3. get()
  4. print()

4. The printf() function is used to display choose which one is correct: 

  1. Text
  2. Constants or values of variables 
  3. Both a & b
  4. None 

5.            is not used in control or format string in a printf() function choose which one is correct: 

  1. Text
  2. escape sequences
  3. format specifiers
  4. variables

6. How many variables can be used in one printf() function choose which one is correct? 

  1. Only one
  2. Two
  3. Three
  4. Many

7.           is control string in the statement printf(“Result = %d”,r); choose which one is correct: 

  1. %d
  2. Result = %d
  3. r
  4.  None 

8. The functions used for input and output are stored in header file choose which one is correct: 

  1. conio.h
  2.  math.h 
  3. output.h
  4. stdio.h 

9.          is used for flag choose which one is correct: 

  1.  +
  2. – 
  3. Both a and b
  4. None 

10. The format specifier %u is used for choose which one is correct:

  1. Integer
  2. Unsigned Short int
  3. Unsigned float
  4. Unsigned long int 

11. The escape sequence for carriage return is 

  1. \a
  2.  \c 
  3. \r
  4.  \f 

12. Which of the following forma specifier is used for character type data 

  1. \c
  2.  %c
  3. %s
  4.  %ch

13. What will be the output of printf(“%d”,’a’);  choose which one is correct? 

  1. 65
  2.  A
  3. 97
  4. a

14.         format specifiers is used for integer type data choose which one is correct:

  1. %d
  2. %s
  3. %c
  4. %f

15.        format specifiers is used for float type data choose which one is correct:

  1. %d
  2. %s
  3. %c
  4. %f 

16. The %x is a format specifier for choose which one is correct:

  1. long integer value
  2. octal value
  3. hexadecimal value
  4.  double value

17. How many digits are printed to the right of the decimal point in real number choose which one is correct?

  1.  15
  2. 3
  3. 6

18.         is used with format specifier to display output left-justified choose which one is correct:

  1. %
  2.  + 
  3.  * 

19. The escape sequence to insert horizontal tab is 

  1. \r
  2. \f 
  3. \tab
  4.  \t 

20. Which of the following format specifier is used for string type data choose which one is correct? 

  1. %s
  2. %c
  3. %f
  4.  %string

21. What will be the output of printf(“%.3f”,3.45678);  choose which one is correct? 

  1. 345678
  2. 3.45678
  3. 3.457
  4. none of above 

22. What will be the output of printf(“%d”, ‘A’);  choose which one is correct? 

  1. A
  2. 65 
  3. ‘A’
  4. 97 

23. Which will be the output of printf(“%c”, ‘A’);  choose which one is correct? 

  1. A
  2. 65 
  3. ‘A’
  4.  97  

24.          is the general form of format specifier for real value choose which one is correct:

  1. m.n%f
  2. %m.nf
  3. %fm.n
  4.  None 

25. What will be the output of printf(“% .2f”, 5.555);  choose which one is correct? 

  1. 5.555
  2.  5.55 
  3. 5.56
  4. 5.00 

26          characters indicates the beginning of escape sequence choose which one is correct:

  1. \
  2.  / 
  3. |

27. The escape sequence to insert tab in C is choose which one is correct:

  1. \n
  2.  \t 
  3. \r
  4.  \f 

28.          is used to move the cursor at the beginning of current line choose which one is correct: 

  1. \n
  2. \t
  3. \r
  4. \f 

29.          can be used to begin a new line in C choose which one is correct: 

  1. \n
  2. \a 
  3. \r
  4.  \b 

30. The escape sequence to produce beep from computer speaker is choose which one is correct:

  1.  \t
  2. \a 
  3. \n
  4.  \b 

31.        is a correct statement to print “Pakistan” in double quotes choose which one is correct: 

  1. printf(““Pakistan””);
  2. printf(“\”Pakistan”\”)
  3. printf(“\”Pakistan\””);
  4. None 

32. The field width will automatically _________ if the specified space is not  sufficient to accommodate the value 

  1. Adjusted
  2. Shrink
  3. Expand
  4. All of Above 

33. A format specifier always begins with the __ symbol 

  1. %
  2.  \ 
  3. /
  4.  %d

34. Escape sequence characters always begins with a ___ character

  1. %
  2.  \
  3. /
  4.  %d

35. Which characters cause an escape from the normal interpretation of a string so  that the next character is recognized as having a special meaning.

  1. Format String
  2. Format Specifier
  3. Special Characters
  4. Escape Sequences

36.            is a correct statement to input value to a variable ‘x’ of float data type choose which one is correct: 

  1. scanf(“%f”, x);
  2. scanf(x);
  3. scanf(“%f’,&x);
  4. scanf(&x);

37. The ampersand (&) used in “scanf()” function is called choose which one is correct:

  1. address indicator
  2. cell address
  3. binary operator
  4. address operator

38. The function getche() is defined in choose which one is correct:

  1. stdio.h
  2. string.h 
  3. math.h
  4. conio.h 

39. Which escape sequence is used for backspace 

  1. \B
  2.  \b
  3. /b
  4.  /s

40. scanf() function is used to get data from the 

  1. computer
  2. processor
  3. input device
  4. program

41.         is used to get input from user during program execution choose which one is correct: 

  1. scanf()
  2. gets()
  3. getche()
  4. All of these

42.  is used to get input from user into any types of variables during the  execution of program choose which one is correct: 

  1. scanf()
  2. gets()
  3. getche()
  4. getch()

43. Instead of the variable name the scanf() requires _________ of the variable to  store the input value into it 

  1. Name
  2. Address
  3. Operator
  4. Data

44. Which character is used as address of operator

  1. $
  2.  choose which one is correct?
  3. #
  4.  &

45. getch() function is used to input ____ character 

  1. One
  2. Many
  3. Two
  4. All of Above 

46. getche() function is used to input ____ character 

  1. One
  2. Many
  3. Two
  4. All of Above 

47. Which input function will not print the entered character on the screen

  1. scanf()
  2. getch()
  3. getche()
  4. getline()