sample output...
ex.1
enter a number: 5

*****
*****
*****
*****
*****

ex2. enter a number: 2

**
**

sergent commented: homework -1

Recommended Answers

All 10 Replies

what is the problem. Could you please paste your code.

The problem is that the OP doesn't know how to solve this particular problem, and wants someone else to do it instead.

#include <iostream>
using namespace std;

int main()
{

  int number;
  cout<<"please input the number:  ";
  cin>>number;
   for(int i=0; i<number; i++) {
       for(int j=0; j<number; j++) cout<<"*";
       cout<<endl;
   }



cout<<endl;

}
commented: Do NOT post homework solutions for others. Especially poorly formatted ones. After all, he should not get graded on YOUR work. -4

I Still dont understand what the problem is? what are you attempting to do and what is different / incorrect to the desired output?

it looks like ztdep has done it. please mark the thread as solved when your problem is solved ;)

Yes, zdep had posted badly formatted code to solve aomas98's problem. What grade do you think zdep should get for his effort? What about aomas98? Who should pass the class?

Yes, zdep had posted badly formatted code to solve aomas98's problem. What grade do you think zdep should get for his effort? What about aomas98? Who should pass the class?

The problem can be solved with many ways. I solved it in a more straight way. Every one should help other people more actively, I do not want a grad.

Yes, it can be solved in may ways. And why should someone find a different way when you hand the answer to them? They do not deserve a grade for your work. Please do not solve their problems. Help them solve it themselves.

The problem can be solved with many ways. I solved it in a more straight way. Every one should help other people more actively, I do not want a grad.

HAHHAHAH FacePalm. He totally didn't get it.

Yes, zdep had posted badly formatted code to solve aomas98's problem. What grade do you think zdep should get for his effort? What about aomas98? Who should pass the class?

ztdep deserves the detah penalty, aomas98 deserves life in prison, with parole. What do I win?

commented: You win th3 shobadobs b3st piano play3r award on Youtube. +15
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.