Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //nested loops=triangle!
- //Mrs. Kubik
- //Olivia Pagach
- #include <iostream>
- using namespace std;
- int getInput ()
- {
- int x;
- cout << "How tall would you like the triangle to be?" << endl;
- cin >> x;
- return x;
- }
- int main()
- {
- int x = getInput ();
- for (int i=1;i<=x;i++)
- {
- for(int j=1;j<=i;j++)
- {
- cout<<"*";
- }
- cout<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement