In C Write a function that outputs a number of stars For exa

In C++

Write a function that outputs a number of stars. For example, 5 would output 5: *****

The function must conform to the following:

Name: output_stars
Parameters:int num - The number of stars that will be output on the console.
Return type: void

Put this code in a file called star.cpp. Do not include a main function.

Solution

Here is link:

http://www.mediafire.com/file/nft0tq497tv2ymf/star.cpp

Here is code:

#include <iostream>

using namespace std;

void output_stars(int num)
{
   //loops from 0 to num
for(int i = 0 ; i < num ; i++)
{
cout<< \"*\";
}
}

In C++ Write a function that outputs a number of stars. For example, 5 would output 5: ***** The function must conform to the following: Name: output_stars Para

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site