diff --git a/Pattern/Pattern7.md b/Pattern/Pattern7.md new file mode 100644 index 0000000..33d7a1d --- /dev/null +++ b/Pattern/Pattern7.md @@ -0,0 +1,47 @@ +## Description +In this code you will find how you can make * pattern by using For loop + +## Code +```cpp + +#include +using namespace std; +int main() +{ +int n, s, i, j; +cout << "Enter number of rows: "; +cin >> n; +for(i = 0; i <= n; i++) +{ +for(s = n; s > i; s--) +cout << " "; +for(j=0; j i; j--) +cout << "* "; +// ending line after each row +cout << "\n"; +} +return 0; +} +``` +## Input +``` +N = 4 +``` +## Output +``` + * + * * + * * * +* * * * + * * * + * + +``` \ No newline at end of file diff --git a/Pattern/Pattern8.md b/Pattern/Pattern8.md new file mode 100644 index 0000000..946f307 --- /dev/null +++ b/Pattern/Pattern8.md @@ -0,0 +1,48 @@ +## Description +In this code you will find how you can make * pattern by using For loop + +## Code +```cpp + +#include +using namespace std; +int main() +{ +int n, i , j; +cout << "Enter number of rows: "; +cin >> n; +for(i = 1; i <= n; i++) +{ +for(j = 1; j <= i; j++) +{ +cout << "*"; +} +cout<<"\n"; +} +for(i = n; i >= 1; i--) +{ +for(j = 1; j <= i; j++) +{ +cout << "*" ; +} +// ending line after each row +cout<<"\n"; +} +return 0; +} +``` +## Input +``` +N = 4 +``` +## Output +``` +* +** +*** +**** +**** +*** +** +* +``` \ No newline at end of file