Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Chapter 4 All MCQS

1. Character set of a C Language contains:


a) Alphabets
b) Digits
c) Special Symbols
d) All of these
Answer: d) All of these

2. A variable name can have:


a) Any Special symbol
b) Blank Space
c) Comma()
d) Underscore
Answer: d) Underscore

3. In C language one of the following is not a valid data


type:
a) Long
b) Float
c) Double
d) Char
Answer: d) Char

4. The format string %if used for:


a) float
b) double
c) unsigned int
Chapter 4 All MCQS
d) long double
Answer: b) double

5. A variable of type unsigned int can have a value in the


range of:
a) -32768 to +32768
b) 0 to 32767
c) 0 to 65535
d) -32767 to +32767
Answer: c) 0 to 65535

6. Which type of data is not a primary data type:


a) int
b) array
c) float
d) char
Answer: b) array

7. Which of the format strings is not valid:


a) %ld
b) %lf
c) %lu
d) %lc
Answer: d) %lc

8. Which is the valid string data:


Chapter 4 All MCQS
a) 'A'
b) A
c) "A"
d) None of these
Answer: c) "A"

9. How much memory is required to store a value of type


double:
a) 4 bytes
b) 6 bytes
c) 8 bytes
d) 10 bytes
Answer: c) 8 bytes

10. The modifier which is used to declare a variable as


constant:
a) Short
b) Signed
c) Unsigned
d) Const
Answer: d) Const

11. Variable is a:
a) Location in memory
b) Location in CPU registers
c) Both
Chapter 4 All MCQS
d) None
Answer: a) Location in memory

12. int can store:


a) Real numbers
b) Character
c) String
d) None of these
Answer: d) None of these

13. The arithmetic operator '%' can be used with:


a) int
b) float
c) double
d) void
Answer: a) int

14. '%d' is the conversion letter for:


a) char
b) int
c) float
d) double
Answer: b) int

15. Binary operators need:


a) One operand
Chapter 4 All MCQS
b) Two operands
c) Three operands
d) None of these
Answer: b) Two operands

16. Which is the symbol for AND operator:


a) ||
b) &&
c) $$
d) None of these
Answer: b) &&

17. >> operator is used for:


a) Right shift
b) Left shift
c) Both
d) None of these
Answer: a) Right shift

18. C program starts executing from:


a) main()
b) Header file
c) Both
d) None of these
Answer: a) main()
Chapter 4 All MCQS
19. Which is the correct variable name:
a) for
b) goto
c) character
d) if
Answer: c) character

20. '\n' is used for:


a) Alert
b) New line
c) Form feed
d) Backspace
Answer: b) New line

You might also like