Click here to Skip to main content
Sign Up to vote bad
good
See more: C++
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;
}
Posted 11 Jan '13 - 8:09
Edited 11 Jan '13 - 21:05

Comments
Sergey Alexandrovich Kryukov - 11 Jan '13 - 17:52
As a very first step, stop confusing other. Please. Out of your 3 "answers", only one was the real answer. Please understand that "Add your solution here" input box is reserved for messages posted to provide some kind of help, in response to some member's question in this forum, not for comments or clarifications of your questions. Please also understand that such misplaced posts can hardly help you, but some members will give you down-votes or abuse reports, something you don't want. You can add comments, use "Improve question", reply to existing comment. Note that members receive notifications on posts related to their posts. Thank you for understanding, —SA
Sergey Alexandrovich Kryukov - 11 Jan '13 - 17:55
As to your assignment, you really need to do it by yourself. However, if you stuck, you can show your work and explain the problem. This way, you can get some help. —SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 228
1 Ron Beyer 220
2 Mahesh Bailwal 215
3 Rohan Leuva 210
4 Sergey Alexandrovich Kryukov 162
0 Sergey Alexandrovich Kryukov 8,548
1 OriginalGriff 6,819
2 CPallini 3,648
3 Rohan Leuva 2,933
4 Maciej Los 2,288


Advertise | Privacy | Mobile
Web01 | 2.6.130516.1 | Last Updated 12 Jan 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid