[go: up one dir, main page]

0% found this document useful (0 votes)
39 views10 pages

Aio Top 100 Basic C Programming MCQ

The document contains a collection of 100 multiple-choice questions (MCQs) related to the C programming language, covering various topics such as data types, operators, control structures, and functions. Each question is followed by multiple answer options and the correct answer is provided. This resource is designed for individuals preparing for exams or enhancing their knowledge in C programming.

Uploaded by

Ranjan Mohanty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views10 pages

Aio Top 100 Basic C Programming MCQ

The document contains a collection of 100 multiple-choice questions (MCQs) related to the C programming language, covering various topics such as data types, operators, control structures, and functions. Each question is followed by multiple answer options and the correct answer is provided. This resource is designed for individuals preparing for exams or enhancing their knowledge in C programming.

Uploaded by

Ranjan Mohanty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

TOP 100 C MCQ FOR QUESTION BANK COURSE

OPSC AIO TOP 100 BASIC C PROGRAMMING MCQ

1. Which of the following language is the predecessor to C Programming Language?


a) A
b) B
c) BCPL
d) C++
Ans: c

2. C programming language was developed by


a) Dennis Ritchie
b) Ken Thompson
c) Bill Gates
d) Peter Norton
Ans: a

3. C was developed in the year


a) 1970
b) 1972
c) 1976
d) 1980
Ans: b

4. C is a language
a) High Level
b) Low Level
c) Middle Level
d) Machine Level
Ans: c

5. C language is available for which of the following Operating Systems?


a) DOS
b) Windows
c) Unix
d) All of these
Ans: d

6. Which of the following symbol is used to denote a pre-processor statement?


a) !
b) #
c) ~
TOP 100 C MCQ FOR QUESTION BANK COURSE

d) ;
Ans: b

7. Which of the following is a Scalar Data type


a) Float
b) Union
c) Array
d) Pointer
Ans: a

8. Which of the following are tokens in C?


a) Keywords
b) Variables
c) Constants
d) All of the above
Ans: d

9. What is the valid range of numbers for int type of data?


a) 0 to 256
b) -32768 to +32767
c) -65536 to +65536
d) No specific range
Ans: b

10. Which symbol is used as a statement terminator in C?


a) !
b) #
c) ~
d) ;
Ans: d

11. Which escape character can be used to begin a new line in C?


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

12. Which escape character can be used to beep from speaker in C?


a) \a
b) \b
c) \m
TOP 100 C MCQ FOR QUESTION BANK COURSE

d) \n
Ans: a

13. Character constants should be enclosed between


a) Single quotes
b) Double quotes
c) Both a and
b d) None of these
Ans: a

14. String constants should be enclosed between


a) Single quotes
b) Double quotes
c) Both a and b
d) None of these
Ans: b

15. Which of the following is invalid?


a) ‘’
b) ““
c) ‘a’
d) ‘abc’
Ans: d

16. The maximum length of a variable in C is


a) 8
b) 16
c) 32
d) 64
Ans: a

17. What will be the maximum size of a float variable?


a) 1 byte
b) 2 bytes
c) 4 bytes
d) 8 bytes
Ans: c

18. What will be the maximum size of a double variable?


a) 1 byte
b) 4 bytes
c) 8 bytes
TOP 100 C MCQ FOR QUESTION BANK COURSE

d) 16 bytes
Ans: c

19. A declaration float a,b; occupies of memory


a) 1 byte
b) 4 bytes
c) 8 bytes
d) 16 bytes
Ans: c

20. The size of a String variable is


a) 1 byte
b) 8 bytes
c) 16 bytes
d) None of these
Ans: d

21. Which of the following is an example of compounded assignment statement?


a) a=5
b) a+=5
c) a=b=c
d) a=b
Ans: b

22. The operator && is an example for operator.


a) Assignment
b) Increment
c) Logical
d) Rational
Ans: c

23. The operator & is used for


a) Bitwise AND
b) Bitwise OR
c) Logical AND
d) Logical OR
Ans: a

24. The operator / can be applied to


a) integer values
b) float values
c) double values
TOP 100 C MCQ FOR QUESTION BANK COURSE

d) All of these
Ans: b

25. The equality operator is represented by


a) :=
b) .EQ.
c) =
d) ==
Ans: d

26. Operators have hierarchy. It is useful to know which operator


a) is most important
b) is used first
c) is faster
d) operates on large numbers
Ans: b

27. The bitwise AND operator is used for


a) Masking
b) Comparison
c) Division
d) Shifting bits
Ans: a

28. The bitwise OR operator is used to


a) set the desired bits to 1
b) set the desired bits to 0
c) divide numbers
d) multiply numbers
Ans: a

29. Which of the following operator has the highest precedence?


a) *
b) ==
c) =>
d) +
Ans: d

30. The associativity of ! operator is


a) Right to Left
b) Left to Right
c) (a) for Arithmetic and (b) for Relational
TOP 100 C MCQ FOR QUESTION BANK COURSE

d) (a) for Relational and (b) for Arithmetic


Ans: a

31. Which operator has the lowest priority?


a) ++
b) %
c) +
d) ||
Ans: d

32. Which operator has the highest priority?


a) ++
b) %
c) +
d) ||
Ans: a

33. Operators have precedence. Precedence determines which operator is


a) faster
b) takes less memory
c) evaluated first
d) takes no arguments
Ans: c

34. Integer Division results in


a) Rounding the fractional part
b) Truncating the fractional part
c) Floating value
d) An Error is generated
Ans: b

35. Which of the following is a ternary operator?


a) ?:
b) *
c) sizeof
d) ^
Ans: a

36. What will be the output of the expression 11 ^ 5?


a) 5
b) 6
c) 11
TOP 100 C MCQ FOR QUESTION BANK COURSE

d) None of these
Ans: d

37. The type cast operator is


a) (type)
b) cast()
c) (;;)
d) // ” ”
Ans: a

38. Explicit type conversion is known as


a) Casting
b) Conversion
c) Disjunction
d) Separation
Ans: a

39. The operator + in a+=4 means


a) a=a+4
b) a+4=a
c) a=4
d) a=4+4
Ans: a

40. p++ executes faster than p+1 because


a) p uses registers
b) p++ is a single instruction
c) ++ is faster than +
d) None of these
Ans: b

41. Which of the following statements is true?


a) C Library functions provide I/O facilities
b) C inherent I/O facilities
c) C doesn’t have I/O facilities
d) Both (a) and (c)
Ans: a

42. Header files in C contain


a) Compiler commands
b) Library functions
c) Header information of C programs
TOP 100 C MCQ FOR QUESTION BANK COURSE

d) Operators for files


Ans: b

43. Which pair of functions below are used for single character I/O.
a) Getchar() and putchar()
b) Scanf() and printf()
c) Input() and output()
d) None of these
Ans: a

44. The printf() function retunes which value when an error occurs?
a) Positive value
b) Zero
c) Negative value
d) None of these
Ans: c

45. Identify the wrong statement


a) putchar(65)
b) putchar(‘x’)
c) putchar(“x”)
d) putchar(‘\n’)
Ans: c

46. Which of the following is charecter oriented console I/O function?


a) getchar() and putchar()
b) gets() and puts()
c) scanf() and printf()
d) fgets() and fputs()
Ans: a

47. The output of printf(“%u”, -1) is


a) -1
b) minimum int value
c) maxium int value
d) Error message
Ans: c

48. An Ampersand before the name of a variable denotes


a) Actual Value
b) Variable Name
c) Address
TOP 100 C MCQ FOR QUESTION BANK COURSE

d) Data Type
Ans: c

49. Symbolic constants can be defined using


a) # define
b) const
c) symbols
d) None of these
Ans: b

50. Null character is represented by


a) \n
b) \0
c) \o
d) \e
Ans: b

51. Which header file is essential for using strcmp() function?


a) string.h
b) strings.h
c) text.h
d) strcmp.h
Ans: a

52. malloc() function used in dynamic allocation is available in which header file?
a) stdio.h
b) stdlib.h
c) conio.h
d) mem.h
Ans: b

53. File manipulation functions in C are available in which header file?


a) streams.h
b) stdio.h
c) stdlib.h
d) files.h
Ans: d

54. C supports how many basic looping constructs


a) 2
b) 3
c) 4
TOP 100 C MCQ FOR QUESTION BANK COURSE

d) 6
Ans: b

55. A statement differs from expression by terminating with a


a) ;
b) :
c) NULL
d) .
Ans: a

56. What should be the expression return value for a do-while to terminate
a) 1
b) 0
c) -1
d) NULL
Ans: b

57. Which among the following is an unconditional control structure


a) do-while
b) if-else
c) goto
d) for
Ans: c

58. Continue statement is used


a) to go to the next iteration in a loop
b) come out of a loop
c) exit and return to the main function
d) restarts iterations from the beginning of the loop
Ans: a

59. Which operator in C is called a ternary operator


a) if..then
b) ++
c) ?:
d) ()
Ans: c

60. Which of the following header file is required for strcpy() function?
a) string.h
b) strings.h
c) files.h

You might also like