here's my question:
write a program that asks the user to type the value of N and writes this picture :
N=1
*
N=2
**
*
N=3
***
**
*
any help?
tips how can i start??
thanks
here's my question:
write a program that asks the user to type the value of N and writes this picture :
N=1
*
N=2
**
*
N=3
***
**
*
any help?
tips how can i start??
thanks
You need something like this:
(see the file attached...)
there you have two examples of loops
- do while loop
- for do loop
If you need anyhelp, just ask....
#include<iostream>
#include<conio.h>
int main()
{
using namespace std;
int numOfStars = 0;
do
{
cout<<"N=";
cin>>numOfStars;
if(numOfStars != 9999)
{
for(int count = 0; count < numOfStars; ++count)
cout<<"*";
}
cout<<endl;
}
while(numOfStars != 9999);
}
> here's my question:
http://www.daniweb.com/forums/announcement8-2.html
> tips how can i start??
int main ( ) {
return 0;
}
Then
- prompt for an integer
- write a loop which counts backwards
- then...
@deanus
That doesn't help them - spoon-feeding an answer.
All you've done is given them something to run off to teacher with.
Oh, sorry, those weren't my intentions! I'm a C++ beginner myself... and I'm also new to this forum.... sorry again...
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.