Question: Write a C++ program using while loop(s) which prompts and reads a single integer n between 1 and 5 (inclusive) and then displays the Floyd's

Write a C++ program using while loop(s) which prompts and reads a single integer n between 1 and 5 (inclusive) and then displays the Floyd's Triangle, which is a right triangle with n rows. The triangle is filled with consecutive numbers starting with 1 at the top left corner. The triangle is formatted such that numbers with a single digit will have an underscore displayed after it. Here are the triangles for each value of n: Write your program within the main function below using the algorithm provided (see comments). Prompt the user for an integer n with the message " Enter n:". If the user does not enter an integer between 1 and 5 (inclusive) then prompt again with " Enter n:' and read the input again until the user enters valid input. You will not receive credit if you use for loop(s). You will be graded for correct syntax, proper style and indentation, choice of variable names, and logical correctness. Do NOT write ANY comments. #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
