Fill in the blanks Question 1 (10 points) Question 1 options: Complete the follo
ID: 3558922 • Letter: F
Question
Fill in the blanks
Question 1 (10 points)
Question 1 options:
Complete the following code:
Write a correctly indented for-loop structure that generates and prints the integers 10 11 12 13 14 15 to the screen. Remember to declare any variables you use.
for (int i =
_____ ; i < ______; i++)
{
cout << ______;
}
Question 2
Question 2 options:
Complete the following code:
Write a correctly indented for-loop structure that generates and prints the integers 9 8 7 6 5 to the screen. Remember to declare any variables you use.
for (int i = 9; i
_______ 5; _______)
{
cout << i;
}
Explanation / Answer
Write a correctly indented for-loop structure that generates and prints the integers 10 11 12 13 14 15 to the screen. Remember to declare any variables you use.
for (int i = 10 ; i < 16; i++) // i should start with 10 and increment till 15 so condition should be i < 16
{
cout << i;
}
Write a correctly indented for-loop structure that generates and prints the integers 9 8 7 6 5 to the screen. Remember to declare any variables you use.
for (int i = 9; i>=5; i--) // i should start with 9 and decrement till 5 so condition should be i>=5 with i--
{
cout << i;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.