A Collection of Code Snippets in as Many Programming Languages as Possible
This project is maintained by TheRenegadeCoder
Welcome to the Baklava in C++ page! Here, you'll find the source code for this program as well as a description of how the program works.
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int i, j, k, n;
n = 21;
for (i = 1; i <= (n + 1) / 2;)
{
for (k = 1; (n + 1) / 2 - i >= k; k++)
cout << " ";
for (j = 1; j < 2 * i; j++)
cout << "*";
cout << "\n";
i++;
}
if (2 * i - 1 >= n)
{
for (i = (n + 1) / 2 - 1; i >= 1; i--)
{
for (k = 1; (n + 1) / 2 - i >= k; k++)
cout << " ";
for (j = 1; j < 2 * i; j++)
cout << "*";
cout << "\n";
}
}
return (0);
}
Baklava in C++ was written by:
If you see anything you'd like to change or update, please consider contributing.
No 'How to Implement the Solution' section available. Please consider contributing.
No 'How to Run the Solution' section available. Please consider contributing.