Computer Science – Class Paper
Unit 2: User Interaction
Question 1: Multiple Choice Questions (4 Marks)
Choose the correct option.
1. Which character is always used at the beginning of an escape sequence?
a) /
b) \
c) |
d) *
2. The escape sequence \n is used to:
a) Move cursor back one space
b) Display double quotes
c) Move cursor to the next line
d) Add a tab space
3. Which operator is used to assign a value to a variable in C?
a) ==
b) :=
c) =
d) →
4. The modulus operator % is used for:
a) Division
b) Multiplication
c) Getting the remainder
d) Subtraction
Question 2: Short Questions (4 Marks)
1. Define escape sequence in C language.
2. Write the output of the statement:
printf("My name is \"Ali\"");
3. What does the \t escape sequence do?
4. Write one difference between integer division and floating-point division in C.
Question 3: Long Question (8 Marks)
Define operators in C language and explain arithmetic operators with examples.