C Programming MCQ Questions and Answers Part – 1

10523

C Programming MCQ Questions and Answers Part – 1

C Programming MCQ Questions and Answers Part – 2

C Programming MCQ Questions and Answers Part – 3

1. The execution of a C program start from _____.
A. function
B. Header file
C. main()
D. Processor
ANSWER: C
2. The C supports _____ basic data types
A. 8
B. 2
C. 10
D. 4
ANSWER: D
3. The C program is converted to machine language using________.
A. An assembler.
B. A compiler.
C. An interpreter.
D. An operating system.
ANSWER: B
4. The C was developed in the year___________.
A. 1972.
B. 1960.
C. 1975.
D. 1971.
ANSWER: B
5. C language has been developed at_________.
A. AT & T Bell labs, USA.
B. IBM, USA
C. Borland International, USA
D. Sun Microsystems
ANSWER: A
6. The C language is an offspring of _________.
A. B language.
B. ALGOL language.
C. BASIC language.
D. ARITHMETIC language
ANSWER: A
7. The programs should be written only in________.
A. lower case.
B. upper case.
C. title case.
D. sentence case.
ANSWER: A
8. The role of a compiler is to translate source program statements to_________.
A. object codes.
B. octal codes.
C. decimal codes.
D. binary codes.
ANSWER: A
9. The extension for C program files by default is_________.
A. .c
B. .d
C. .obj
D. .exe
ANSWER: A
10. An escape sequence commences with _____________.
A. \ .
B. /.
C. ?.
D. #.
ANSWER: A
11. The C language is closely associated with _________.
A. MS-DOS.
B. Linux.
C. Unix.
D. MS-Windows.
ANSWER: C
12. The C program is highly case sensitive
A. false
B. true
C. both (A) and (B)
D. none of the above
ANSWER: B
13. Each instruction in C program is terminated by__________.
A. dot (.).
B. Comma (,).
C. Semi-colon (;)
D. curly brace ({}).
ANSWER: C
14. Which of the following declaration is not supported by C?
A. String str;.
B. char *str;.
C. float str = 3e2;.
D. Both String str; & float str = 3e2;.
ANSWER: A
15. ANSI committee was setup in the summer of___________.
A. 1983.
B. 1985
C. 1990.
D. 1976.
ANSWER: D
16. A declaration float a, b; occupies ___ of memory.
A. 1 Byte.
B. 4 Bytes.
C. 8 Bytes.
D. 16 Bytes.
ANSWER: C
17. Identify the wrong statement.
A. putchar(65).
B. putchar(‘x’).
C. putchar(“x”).
D. putchar(‘ ‘).
ANSWER: C
18. An interpreter reads the source code of a program__________.
A. One line at a time.
B. Two lines at a time.
C. complete program in one stroke.
D. complete program in two strokes.
ANSWER: A
19. A compiler compiles the source code________________.
A. complete program in one stroke.
B. one line at a time.
C. two lines at a time.
D. complete programs in two strokes.
ANSWER: A
20. A character variable can store only___________.
A. 1 character.
B. 20 characters.
C. 254 characters.
D. 265 characters.
ANSWER: A
21. C variable cannot start with_________.
A. a number.
B. an alphabet.
C. a character.
D. a string.
ANSWER: A
22. A short integer variable occupies memory_________.
A. 2 bytes.
B. 4 bytes.
C. 1 byte.
D. 8 bytes.
ANSWER: A
23. According to __________ C keywords are reserved words.
A. a compiler.
B. an interpreter.
C. header file.
D. an interpreter and header file.
ANSWER: A
24. The declaration of C variable can be done________.
A. anywhere in the program.
B. in declaration part.
C. in executable part.
D. at the end of the program.
ANSWER: B
25. In C one statement can declare_________.
A. only one variable.
B. Two variables.
C. Ten variables.
D. any number of variables.
ANSWER: D
26. The word char is a_______.
A. keyword.
B. password.
C. header file.
D. statement.
ANSWER: A
27. The variables are initialized using_________.
A. greater than(>).
B. equal to (=).
C. twice equal to(==).
D. an increment operator(++).
ANSWER: B
28. An unsigned integer variable contains values________.
A. greater or equal to zero.
B. less than zero.
C. only zeros.
D. (1) & (2) both.
ANSWER: A
29. The keyword const keeps the value of a variable_________.
A. constant.
B. mutable.
C. variant.
D. different
ANSWER: A
30. Identifiers are_________.
A. user-defined names.
B. reserved keywords.
C. C statements.
D. tokens.
ANSWER: A
31. In C every variable has_______.
A. a type.
B. a name.
C. a value.
D. a size.
ANSWER: A
32. The range of character data type is_________.
A. -128 to 127.
B. 0 to 255.
C. 0 to 32767.
D. 126 to 275.
ANSWER: A
33. The keyword volatile keeps the value of variable__________.
A. constant.
B. . mutable
C. variant
D. different.
ANSWER: A
34. Which is the incorrect variable name__________.
A. else.
B. name.
C. age.
D. char.
ANSWER: A
35. How many keywords are there in ANSI C?
A. 32.
B. 33.
C. 42.
D. 15.
ANSWER: A
36. How many variables can be initialized at a time?
A. one.
B. two.
C. Five.
D. any number of variables
ANSWER: A
37. Which of the following statement is valid?
A. 5+5=a;
B. ss=12.25;
C. st=m * b;
D. is = A+ 10;
ANSWER: A
38. ___________ refers to the accuracy of the calculations.
A. Integrity.
B. Clartiy.
C. Simplicity.
D. Modularity.
ANSWER: A
39. The variable name can be started with__________.
A. underscore symbol (_).
B. asterisk symbol(*).
C. ampersand symbol(&)
D. minus symbol(-).
ANSWER: A
40. What is the value of sizeof(char)?
A. 1.
B. 0.
C. -1.
D. -2.
ANSWER: A
41. ________ decides which operator is to be used first.
A. Hierarchy.
B. Priority.
C. ladder.
D. Precedence.
ANSWER: D
42. The & operator displays________.
A. address of the variable.
B. value of the variable.
C. result of the variable
D. both (a) & (b).
ANSWER: A
43. Addition of two numbers is performed using _________.
A. arithmetic operator.
B. logical operator.
C. unary operator.
D. comma operator.
ANSWER: A
44. What is the value of 10%8?
A. 8.
B. 2.
C. 1.
D. 0.
ANSWER: B
45. What is the result of the expression (10/3)*3+5%3?
A. 11.
B. 10.
C. 8.
D. 1.
ANSWER: A
46. What is the result of the expression (23*2) % (int) 5.5?
A. 2.
B. 1.
C. 3.
D. 0.
ANSWER: B
47. What is the result of 5/2?
A. 4.
B. 8.
C. 2.
D. 5.
ANSWER: C
48. What is the result of 5&&2?
A. 0.
B. 1.
C. 2.
D. 5.
ANSWER: B
49. Which function is appropriate for accepting a string?
A. gets().
B. getch().
C. getche().
D. scanf().
ANSWER: A
50. What is the ASCII range for 0 to 9 digits?
A. 48 to 57.
B. 65 to 90.
C. 97 to 122.
D. 86 to 93.
ANSWER: C

Previous articlePrinciples of Research Ethics – Academic Integrity Series
Next articleC Programming MCQ Questions and Answers Part – 2
A.Sulthan, Ph.D.,
Author and Assistant Professor in Finance, Ardent fan of Arsenal FC. Always believe "The only good is knowledge and the only evil is ignorance - Socrates"