So I`m trying to solve a simple task by myself but I`ve only been coding for a week. I`ve looked at everyone elses questions to see if they could help me but my brain is not clicking. I`m trying to call my pretty function 6 times within my main function if someone could show me how that would be great.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <iostream>
usingnamespace std;
void pretty( ){
int x = 0;
x++;
for(int i = 0; i < x; ++i){cout<<'*';}
cout<<endl;
}
int main(){
int i = 0;
while(i<=6){
cout<<i++;
}
return 0;
}
I was given the first part by my teacher. The step was to write a main with a loop that calls the function six times. I think he wants us to just tell him what is the output.