Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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:09am
Edited 11-Jan-13 21:05pm
v2
Comments
Sergey Alexandrovich Kryukov at 11-Jan-13 17:52pm
   
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 at 11-Jan-13 17:55pm
   
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 Guruprasad.K.Basavaraju 424
1 Sergey Alexandrovich Kryukov 326
2 Shai Vashdi 318
3 OriginalGriff 265
4 Abhinav S 160
0 Sergey Alexandrovich Kryukov 9,169
1 OriginalGriff 5,290
2 Peter Leow 4,020
3 Maciej Los 3,535
4 Abhinav S 3,263


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