English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

the output of the program must be like this
* * * *
* *
* *
* * * *

2007-03-23 19:16:44 · 5 answers · asked by az 1 in Computers & Internet Programming & Design

the output of the program must be like this
* * * *
* *
* *
* * * *

2007-03-23 19:21:00 · update #1

5 answers

What should be the input buddy?
you may have easist way for this :
cout<<"****"<

:)

2007-03-23 19:42:50 · answer #1 · answered by PC 4 · 0 0

#include
using namespace std;
int main ()
{

int number;
cout<<"enter the char";
cin>> number;

for( int i=1;i<=number;i++)
{


for(int j=1;j<=i;j++)

cout<<"+";
cout<

}


return 0;
}

2007-03-25 05:23:38 · answer #2 · answered by meme n 1 · 0 0

LOL pay attention in class.....
LOL read your book.....

No, but really, it's a simple sub routine...
There are multiple ways of doing this. If its for a class, they usually want you to do it a certain way, let me know, and I'll check later to tell you.

2007-03-23 19:26:01 · answer #3 · answered by coloradobusted 2 · 0 1

If that's all you're giving me, my answer is

"****> cout
"**">cout
"**">cout
"****">cout

I'm sure there's more to that, so, you may as well come clean. :)

2007-03-23 19:25:16 · answer #4 · answered by Kasey C 7 · 0 0

#include
#include
int main()
{
int i,j;
clrscr();
for(i=4;i>0;i--)
{
if((i==4)||(i==2)||(i==0))
continue;
for(j=i;j>=0;j--)
{
cout<<"*";
}
cout<<"\n";
}
for(i=0;i<4;i++)
{
if((i==4)||(i==2)||(i==0))
continue;
for(j=0;j<=i;j++)
{
cout<<"*";
}
cout<<"\n";
}
getch();
return 0;
}

2007-03-24 06:07:29 · answer #5 · answered by pavi 3 · 0 1

fedest.com, questions and answers