C Plus Plus(C++) Programming Language Questions with Answers | Solved MCQs

37. precision() is used to _____________.
  • [A] sets format flags that control the format of output display
  • [B} specifies the number of digits to be displayed after decimal point.
  • [C} clears the flags.
  • [A] specifies the required number of fields to be used while displaying the output value.

Answer: Option [B]

38. Which of the following is not a valid file mode?
  • [A] ios::in
  • [B} ios::out
  • [C} ios::truncate
  • [A] ios::noreplace

Answer: Option [C]

DOWNLOAD CURRENT AFFAIRS PDF FROM APP

Article and Schedule Quiz Start Test!
39. _________ allows access to the specific data without need for accessing its preceding its data items.
  • [A] sequential file
  • [B} random file
  • [C} get file
  • [A] put file

Answer: Option [B]

40. Which one of the following is invalid variable name?
  • [A] 1count
  • [B} count.
  • [C} count1.
  • [A] count_1.

Answer: Option [A]

41. The elements of an array can be accessed by providing integer expression called _______.
  • [A] superscripts.
  • [B} elements.
  • [C} values.
  • [A] subscripts.

Answer: Option [D]

42. ___________ is not a type of scope in c++.
  • [A] Global.
  • [B} Local.
  • [C} File.
  • [A] Function.

Answer: Option [D]

43. Which of the following is the proper keyword to deallocate memory?
  • [A] free
  • [B} delete
  • [C} clear
  • [A] remove

Answer: Option [A]

44. Most of the statement in C++ program should end with ______
  • [A] a full stop (.).
  • [B} a comma (,).
  • [C} a semicolon (;).
  • [A] a colon (:).

Answer: Option [C]

45. If and the switch statements are called as _____ statements.
  • [A] iteration.
  • [B} jump.
  • [C} selection
  • [A] conditional

Answer: Option [C]

46. Find out the error in following block of code. if (x=100) cout<< "x is 100"
  • [A] 100 should be enclosed in quotations
  • [B} There is no semicolon at the end of first line.
  • [C} Equals to operator mistake.
  • [A] Variable x should not be inside quotation.

Answer: Option [C]

47. If the type specifier of parameters of a function is followed by an ampersand (&), that function call is _______.
  • [A] pass by value.
  • [B} pass by value.
  • [C} array of structures.
  • [A] array of structures. pointers.

Answer: Option [B]

48. The general form, of assignment operator is _____.
  • [A] variable_name=expression
  • [B} datatype=expression.
  • [C} variable=expression.
  • [A] datatype=expression.

Answer: Option [A]

Take Mock Tests

Missiles Mock Test Start Test!
SSC MTS Mock Test Start Test
IBPS CLERK MOCK TEST Start Test
SSC MTS 2022 JULY 26 Shift 1 (ENGLISH) Start Test!
SSC GD Previous Year Paper 2021 Nov 17 Shift - I (Hindi) Start Test!
SSC CGL Tier - 1 PYP 2022 April 21 Shift- 1 (ENGLISH) Start Test!
MPSC PAPER I MOCK TEST 1 (ENGLISH) Start Test!
IB Security Assistant Mock test 1 (english) Start Test!
UP POLICE CONSTABLE MOCK TEST 1 Start Test!
DELHI POLICE CONSTABLE MOCK TEST 1 (HINDI) Start Test!