Need help with function outputting stars.

Apr 24, 2013 at 4:09am
I need to write a function that outputs the number of stars for whatever value is entered. Only the function though. For example if 5 outputs *****. It also has to use a void return.
Apr 24, 2013 at 4:29am

hope this will work
1
2
3
4
5
6
void star(int n)// integer input that specify the no of star that u want to display
{
    int i;
    for(i=1;i<=n;++i)
    cout<<"*";
}

cheers,
cyber dude
Apr 24, 2013 at 4:41am
What's the point of doing their homework they just a lazy Ass if they want help that's okay but asking someone to do their hw....
Apr 24, 2013 at 4:46am
hw?? u sure it's a hw qn cz it's too silly to be a hw qn
Last edited on Apr 24, 2013 at 4:50am
Apr 24, 2013 at 5:18am
It's hw we had same assignment at my college and u can tell because he said give me code not hey can I get some help or any suggestions
Last edited on Apr 24, 2013 at 5:19am
Apr 24, 2013 at 5:36am
Even if it weren't given by a "teacher", it would be homework -- something that the OP should learn to do.

Now, replace the iteration with std::setfill and std::setw.
Topic archived. No new replies allowed.