C++ Loop Important MCQs

C++ Loop Important MCQs

C++ Loop Important MCQs

  1. Which Loop is Faster in C++?
  2. (a) For
    (b) While
    (c) Do While
    (d) All work at same speed

    (d) All work at same speed

  3. Size of a Turbo C/C++ Compiler is?
  4. (a) 16 Bit
    (b) 32 Bit
    (c) 64 Bit
    (d) None

    (a) 16 Bit

  5. ASCII Value of '\0' Character is?
  6. (a) 0
    (b) 48
    (c) 32
    (d) 65

    (a) 0

  7. Which of the following is a formate String?
  8. (a) \n
    (b) &
    (c) %d
    (d) none

    (c) %d

  9. Do While Loop is a also known as ______.
  10. (a) Entry Control
    (b) Per Tested
    (c) Exit Control
    (d) All of Above

    (c) Exit Control

  11. What is the Ranged of Signed Char?
  12. (a) 0 to 255
    (b) -128 to 127
    (c) 127 to -128
    (d) 0 to 127

    (b) -128 to 127

  13. What is the size of Following Struct(Turbo C++ 16 Bit Compiler)?
  14. Syntax :


    Struct
    {
    int a;
    char b;
    float c;
    }

    (a) 2 Bytes
    (b) 4 Bytes
    (c) 10 Bytes
    (d) 7 Bytes

    (d) 7 Bytes
    In Struct you can add all the bytes

  15. Whic of the following is Logical AND Operator?
  16. (a) ||
    (b) &
    (c) &&
    (d) !

    (c) &&

  17. Which of the following is a subscript operator?
  18. (a) *
    (b) {}
    (c) []
    (d) ()

    (c) [] they used in Array

  19. Which loop is guaranteed to execute at-least once?
  20. (a) for loop
    (b) while loop
    (c) do-while loop
    (d) None

    (c) do-while loop

  21. What will be the output of the following C++ code?

  22. #include <iostream>
    using namespace std;
    int main() {
    int n ;
    for (n = 5; n < 0; n--)
    {
    cout << n;
    if (n == 3)
    break;
    }
    return 0;
    }

    (a) 543
    (b) 42
    (c) 46
    (d) 78

    (a) 543

  23. the destination statement for the goto label is identified by what label?
  24. (a) $
    (b) @
    (c) *
    (d) :

    (d) : (Colon)

  25. how are many sequences of statements present in c++?
  26. (a) 1
    (b) 4
    (c) 5
    (d) 8

    (c) 5

  27. Decision Control statements in C++ can be implemented using?
  28. (a) if
    (b) if-else
    (c) Conditional Operator
    (d) All of the above

    (d) All of the above

  29. What will be the output of the following C++ code?
  30. #include <iostream>
    using namespace std;
    int main() {

    if (0) {
    cout << "Hello";
    }
    else
    {
    cout << "Good Bye";
    }
    return 0;
    }

    (a) Hello
    (b) HelloGood by
    (c) Good Bye
    (d) Compilation Error

    (c) Good Bye

  31. what is correct syntax of for loop in c++?
  32. (a)

    for (statement 1; statement 2; statement 3) {
    // code block to be executed
    }

    (b)

    for (statement 1; statement 2; statement 3) {
    // code block to be executed
    }

    (c)

    for (statement 1, statement 2, statement 3) {
    // code block to be executed
    }

    (d)

    for (statement 1: statement 2: statement 3) {
    // code block to be executed
    }

    (a)

  33. The if...else statement can be replaced by which operator?
  34. (a) Addition operator
    (b) Multiplicative operator
    (c) Conditional operator
    (d) Bitwise operator

    (c) Conditional operator

  35. how many minimum number of functions should be present in a c++ program for its execution?
  36. (a) 0
    (b) 1
    (c) 2
    (d) 3

    (b) 1

  37. What is the correct Syntax of do while loop?
  38. (a)

    do {
    // code block to be executed
    }
    while (condition);

    (b)

    do(condition) {
    // code block to be executed
    }
    while;

    (c)

    while {
    // code block to be executed
    }
    do (condition);

    (d)

    do {
    // code block to be executed

    while (condition)
    };

    (a)

  39. What will be the output of the following code?
  40. #include <iostream>

    using namespace std;

    int main() {
    for (int i = 1; i <= 5; ++i) {
    cout << i << " ";
    }
    return 0;
    }

    (a) 1 3 4 5
    (b) 1 2 3 4 5
    (c) 5 4 3 2 1
    (d) 4 5 1 2 3

    (b) 1 2 3 4 5

  41. How are many sequences of statements present in c++?
  42. (a) 1
    (b) 2
    (c) 4
    (d) 5

    (d) 5

  43. How many types of loops are there in C++?
  44. (a) 1
    (b) 2
    (c) 3
    (d) 4

    (c) 3 (while loop,for loop, do while loop)

  45. The break statement in repetition structure causes a program to
  46. (a) Again start the loop from 1
    (b) All of them
    (c) Terminate
    (d) Immediately exit

    (d) Immediately exit

  47. Loop is used for ___________.
  48. (a) Selection
    (b) Decision
    (c) Repetition
    (d) None of these

    (c) Repetition

  49. How many tyes of loop are used in C++?
  50. (a) Two
    (b) Three
    (c) Five
    (d) Seven

    (b) Three

  51. Which of the following is NOT a loop?
  52. (a) for
    (b) while
    (c) do while
    (d) while do

    (d) while do

  53. Which of the loop is also called counter loop?
  54. (a) for
    (b) do while
    (c) while
    (d) All of these

    (a) for

  55. One execution of the loop is known as a/an?
  56. (a) Test
    (b) Iteration
    (c) Repeated
    (d) All of these

    (b) Iteration

  57. The loop which never ends is called ______.
  58. (a) Counter Loop
    (b) Infinite Loop
    (c) Nested Loop
    (d) None of these

    (b) Infinite Loop

  59. The for loop contains _________ expressions.
  60. (a) 3
    (b) 4
    (c) 7
    (d) 9

    (a) 3

  61. A for loop contains three expression: initialization, condition, and _______.
  62. (a) Increment
    (b) Decrement
    (c) Increment/Decrement
    (d) Validat

    (c) Increment/Decrement

  63. It is the simplest loop in c++ langauge?
  64. (a) for loop
    (b) while loop
    (c) do while
    (d) Nested Loop

    (a) for loop

  65. Which of the following loop is called entry controlled loop?
  66. (a) for loop
    (b) while loop
    (c) do while
    (d) None

    (b) while loop

  67. Which of the following is pre tested loop in c++?
  68. (a) for loop
    (b) while loop
    (c) do while
    (d) Nested Loop

    (b) while loop

  69. Which of the following is post tested loop in c++?
  70. (a) for loop
    (b) while loop
    (c) do while loop
    (d) None of these

    (c) do while loop

  71. In which loop the condition comes before the body of the loop?
  72. (a) for loop
    (b) while loop
    (c) do while loop
    (d) Nested Loop

    (b) while loop

  73. In which loop the condition comes after the body of the loop.
  74. (a) for loop
    (b) while loop
    (c) do while loop
    (d) Nested Loop

    (c) do while loop

  75. Semicolon is placed at the end of condition in ___________.
  76. (a) for loop
    (b) while loop
    (c) do while loop
    (d) Nested Loop

    (c) do while loop

  77. A loop within a loop is called __________ loop.
  78. (a) for loop
    (b) while loop
    (c) do while loop
    (d) Nested Loop

    (c) do while loop

  79. The statements within curly braces in a loop is known as _____________.
  80. (a) Statement
    (b) Part
    (c) Body
    (d) All of these

    (c) Body

  81. Which of the following is NOT a loop.
  82. (a) for loop
    (b) while loop
    (c) do while loop
    (d) for if loop

    (d) for if loop

  83. What is correct syntax of for loop?
  84. (a) for(initialization:condition:increment/decrement);
    (b) for(initialization:condition:increment/decrement)
    (c) for(initialization; condition;increment/decrement)
    (d) for(initialization;condition;increment/decrement);

    (c) for(initialization; condition;increment/decrement)

  85. Which of the ends multiple Statements while loop?
  86. (a) Semicolon (;)
    (b) Right Brace
    (c) Right Bracket
    (d) All of these

    (b) Right Brace

  87. What is correct syntax of do while loop?
  88. (a) do{ body of loop} while(condition)
    (b) do{ body of loop} while(condition);
    (c) do{ body of loop} while(condition):
    (d) while{ body of loop } do(condition);

    (b) do{ body of loop} while(condition);

  89. What is correct syntax of while loop?
  90. (a) while (condition) [ body of loop ]
    (b) while { body of loop }
    (c) while (condition) { body of loop }
    (d) while (condition); { body of loop }

    (c) while (condition) { body of loop }

  91. for, while and do is the _______.
  92. (a) Variable
    (b) Data Type
    (c) Keywords
    (d) All of these

    (c) Keywords

  93. Which is the correct ?
  94. (a) for(int i = 0: i<=10: i++)
    (b) for(int i = 0; i<=10; i++)
    (c) for(int i = 0; i<=10; i++);
    (d) for(int i = 0, i<=10; i++)

    (b) for(int i = 0; i<=10; i++)

  95. If you want a user to enter exactly 50 values, which loop would be best to use?
  96. (a) for Loop
    (b) while Loop
    (c) do while Loop
    (d) All of these

    (a) for Loop

  97. You can never use addresss of ______ variable ?
  98. (a) Global
    (b) Static
    (c) Auto
    (d) Register

    (d) Register

  99. The default Storage for local Variables is?
  100. (a) Extren
    (b) Static
    (c) Auto
    (d) Register

    (c) Auto

  101. How many times will "Hello, World" be printed in the below program?
  102. #include <stdio.h>
    int main(){
    int i = 1024;
    for(; i; i >>=1){
    printf("Hello, World");
    return 0;
    }
    }

    (a) 10
    (b) 11
    (c) Infinite
    (d) Compile time Error

    (b) 11

C++ Loop Important MCQs

Related Posts:
Cover Topics

"c++ loop questions and answers","loops in c++ pdf","C++ Loop Important MCQs","solved mcqs of c++ with answers","c++ loop quiz","for loop questions and answers","C++ Mcqs","Interview Questions on Loops in C++","cpp mcqs","multiple choice questions on loops in c++","if else statement in c++ quiz","nested loop mcqs".

Post a Comment

To be published, comments must be reviewed by the administrator.

أحدث أقدم