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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

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

Post by answerhappygod »

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 1
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 1 (18.85 KiB) Viewed 58 times
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. оо
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply