السلام عليكم ورحمة الله وبركاته
انا مبتدئه في ++c علما احب البرمجه واحب تجربة حل الكثير من المسائل لتزداد معلوماتي البرمجيه في هذي اللغه
ولكن قد حاولت حل هذا السؤال
Write a program that uses nested for statements to print the following patterns. All asterisks (*) should be printed by a single statement of the form
cout << ‘*’; (this causes the asterisks to print side by side).
Hint: Pattern B requires that each line begin with an appropriate number of blanks.
*
**
***
****
*****
******
*******
********
والشكل الثاني
*
**
***
****
*****
******
*******
********
لقد حاولت ادخال وحل الشكل الاول بهذه الطريقه ولكن لم احصل على النتيجه
#include <iostream>
using namespace std;
int main ()
{
int rows=1;
int count;
while (rows>=8)
{
count=1;
while (count<=rows)
{
cout<< '*';
count++;
cout<<"endl";
rows++;
}
}
return 0;
}

