Nothing Special   »   [go: up one dir, main page]

0% found this document useful (0 votes)
64 views

Unsolved MCQs

The document contains a test paper for a computer science class with 34 multiple choice questions about input/output functions in C programming such as scanf(), printf(), getch(), and escape sequences. It tests the student's knowledge of format specifiers, field width, escape sequences for newline, carriage return, and others. The questions cover concepts like input functions, formatted output, escape sequences, and format specifiers for different data types.

Uploaded by

Romi Awan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views

Unsolved MCQs

The document contains a test paper for a computer science class with 34 multiple choice questions about input/output functions in C programming such as scanf(), printf(), getch(), and escape sequences. It tests the student's knowledge of format specifiers, field width, escape sequences for newline, carriage return, and others. The questions cover concepts like input functions, formatted output, escape sequences, and format specifiers for different data types.

Uploaded by

Romi Awan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Smart Guess & Test Papers

Student Name ______________________ Father Name ______________________ Roll Number _______


Class: 2nd /Year - Computer Science New Marks : 49 Exam Format : Chapter Wise MCQs
Time : notespk.com_Nauman Sadaf | Date _________________ Examiner Sig __________ Chapter#: 10

MCQ's S/Q L/Q Total

Objective Type

1. Encircle the Correct Option. (1 x 34 = 34)


1) The function getch () is defined in .
a) stdio.h b) string.h c) math.h d) conio.h

2) getch () function is used to input following number of character (s) .


a) 1 b) many c) 2 d) 3

3) Which input function will not print the entered character on the screen ?
a) scanf () b) getch () c) getche () d) getchar ()

4) The function clrscr () is defined in .


a) stdio.h b) math.h c) conio.h d) graphics.h

5) Which of the following function is used to input data in C program ?


a) printf () b) scanf () c) sqrt () d) get ()
6) Function which used to get input from the user .
a) printf () b) scanf () c) clrscr () d) puts ()

7) The function getch () is defined in .


a) stdio.h b) conio.h c) string.h d) math.h

8) The ampersand before the name of a variable denotes .


a) Actual value b) Variable name c) Address d) Data type

9) The escape sequence for carriage return is .


a) \a b) \c c) \r d) \f

10) The function that is used to display output on screen is called .


a) scanf b) pow c) display d) printf

11) How many variables can be used in one printf function ?


a) One b) Two c) Ten d) Many

12) Format specifier starts with symbol .


a) % b) $ c) # d) @

13) The escape sequence for backslash is .


a) \ b) \a c) \n d) \m

14) Which escape sequence is used to begin new line ?


a) \a b) \b c) \m d) \n

15) Which of the following is not a valid escape code ?


a) \t b) \v c) \y d) \f

16) Which of the following format specifier is used for float data type ?
a) %e b) %d c) %f d) %s
17) The format specifier % is used for .
a) Integer b) Unsigned short c) Unsigned float d) Unsigned long int

18) The escape sequence to produce beep from computer speaker is .


a) \t b) \a c) \n d) \b

19) The function used for input and out put is stored in .
a) Stdio.h b) Conio.h c) Math.h d) Tan.h

20) Which function is called formatted output function ?


a) scanf () b) puts () c) printf () d) fputs ()

21) The format specifier % f is used for .


a) double b) float c) int d) long

22) Which of the following are determined by format specifier ?


a) Data type b) Field width c) Format of the value d) All of these
23) How many digits are printed to the right of the decimal point in real number ?
a) 15 b) 3 c) 6 d) 5

24) The field width will automatically _______ if the specified space is not sufficient to accommodate the value .
a) Adjusted b) Shrink c) Expanded d) None of these
25) The function getche() is defined in .
a) stdio.h b) string.h c) math.h d) conio.h

26) The escape sequence for backslash is .


a) \ b) \b c) \\ d) \t

27) The format specifier % u is used for .


a) Interger b) Unsigned short c) Unsigned float d) Unsigned long int
28) In C program , the number of columns that are printed are specified in .
a) Format specifier b) Formatting intergers c) Field with specifier d) Both A & B
29) Escape sequence \\ is use to input .
a) New line b) Backslash c) Space d) Tab
30) Scanf function is used to input .
a) Numeric value b) String value c) Both A & B d) None of above

31) Scanf function stores input value into .


a) Signature of a variable b) Position of a variable c) Constant d) Address of a variable

32) In statement scanf ("%f, %kilometer); , kilometer is a (n) .


a) Integer variable b) Float variable c) String variable d) Double variable

33) getch() is a part of .


a) stdio.h b) conio.h c) math.h d) All of above

34) ASCII code for a character is displayed using format specifier .


a) % d b) % f c) % c d) % x
2. Write "T" for a true statement and "F" for a false statement (1 x 5 = 5)
35) Function printf is used for formatted output .
☐ True ☐ False

36) Format specifier % is used to specify unsigned hexadecimal integer .


☐ True ☐ False

37) A format specifier always begins with &


☐ True ☐ False

38) Escape sequence \ddd is used for carriage return .


☐ True ☐ False

39) The getch and getche functions accept only integer argument .
☐ True ☐ False
3. Fill in the blanks. (1 x 10 = 10)
40) The ___________ function does not display characters on the output screen.

41) ________ is an input function .

42) % is a format specifier for ___________ .

43) Escape sequences always begins with a __________ .

44) The printf function is defined in __________ .

45) The ASCII code for Escape key is ____________ .


46) The escape sequence ___________ represents the carriage return .

47) There are total ___________ columns on the output screen .

48) The symbol for address of operator is ___________ .

49) \ddd is used to print ASCII code in ___________ notation .

You might also like