Skip to content

Instantly share code, notes, and snippets.

@alonzoibarra97
Created February 16, 2016 17:14
Show Gist options
  • Save alonzoibarra97/746f29665892e3b2307a to your computer and use it in GitHub Desktop.
Save alonzoibarra97/746f29665892e3b2307a to your computer and use it in GitHub Desktop.
quiz2.2.cpp
#include <iostream>
#include <cstdlib>
int stars (int a, int cont=0)
{
int st;
do{
std::cout <<"*";
cont++;
}while (a > cont);
}
using namespace std;
int main() {
int st,a, cont=0;
cout<< "Give me a number to print *\n";
cin>> a;
st= stars(a);
cout << st;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment