What is wrong with the following code? double[] arr = { 1.1, 2.2, 3.3, 4.4, 5.5 }; for (int i = 0; 5 > i; ++i) std::cout
Posted: Mon May 02, 2022 12:04 pm
What is wrong with the following code? double[] arr = { 1.1, 2.2, 3.3, 4.4, 5.5 }; for (int i = 0; 5 > i; ++i) std::cout << arr << std::endl; Select one: The declaration of the array type is incorrect — the [] must come after the variable name. The loop increment expression should be i++ to avoid potential out of bounds issues occurring from the effect of pre-increment. The loop condition should be i < 5. The for loop body is not enclosed within curly braces. оо