Hi .. Hope You Guys Are At Good State Of Health . !!
I'm Student Of Computer Sciences[BS(CS)] In current Semester I'm enrolled a course called Introduction To Programming. I'm about average in it ..
But whenever teacher gives a question regarding printing asterisks in different manner by using loops (in the test) I'm puzzled .. I don't know what to do ..
Some reading stuff, articles, suggestions would be appreciated..
Senior Software Engineers Please Suggest Some Thing .. !?
#include "stdafx.h"
#include <iostream>
using namespace std;
int main ()
{
int M, row = 0, column = 0, space = 0;
cout << "Please Enter The Number Of Rows to Print Stars in Descending Order: "; cin >> M;
while (row < M)
{
while (column <= row)
{
cout << "*";
while (space <= M - 1)
{
cout << " ";
space++;
}
column++;
}
cout << '\n';
row++;
}
return 0;
}