Problem 10 (5 pts): Write a function in C++ that takes an integer as an input pa
ID: 3743372 • Letter: P
Question
Problem 10 (5 pts): Write a function in C++ that takes an integer as an input parameter, and then prints out an x of stars such that, for example, if the number is 5, the following would be printed out:
Note that if the input parameter is an even number, round up to the next odd number. This should use a nested loop. Test this function with 3 different integers.
Problem 10 (5 pts): Write a function that takes an integer as an input parameter, and then prints out an x of stars such that, for example, if the number is 5, the following would be printed out: te i* Note that if the input parameter is an even number, round up to the next odd number. This should use a nested loop. Test this function with 3 different integers.Explanation / Answer
#include using namespace std; void printX(int n) { if(n % 2 == 0) { n++; } int size = (2*n) - 1; for(int i = 0; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.