Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void main()
- {
- /*
- for (Initialization; Condition; increment)
- {
- }
- */
- /*for (int i = 0; i < 10; i++)
- {
- cout << "Hello World!" << endl;
- }*/
- int spaces = 200;
- int stars = 1;
- for (int i = 1; i <= 15; i++)
- {
- for (int j = 0; j < spaces; j++)
- {
- cout << " ";
- }
- spaces--;
- /*for (int j = 0; j < i * 2 - 1; j++)
- {
- cout << "*";
- }*/
- for (int j = 0; j < stars; j++)
- {
- cout << "*";
- }
- cout << endl;
- stars += 2;
- }
- /*
- while(condition)
- {
- }
- */
- /*int i = 0;
- while (true)
- {
- cout << "Hello World!" << endl;
- i++;
- if (i >= 10)
- break;
- }*/
- int i = 0;
- spaces = 200;
- stars = 1;
- while (i < 15)
- {
- int j = 0;
- while (j < spaces)
- {
- cout << " ";
- j++;
- }
- spaces--;
- j = 0;
- while (j < stars)
- {
- cout << "*";
- j++;
- }
- stars += 2;
- cout << endl;
- i++;
- }
- /*
- do
- {
- }while(condition);
- */
- int x = 10;
- do
- {
- cout << "Hello World!" << endl;
- x++;
- } while (x < 10);
- while (x < 10)
- {
- cout << "Hello World!" << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement