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

Anyone know how to make the following pattren in prog
****
***
**
*
And
*****
*****
*****
and
*
**
***
****
i know i can use loop, but i couldnt and i failed many time, thanks...

2007-02-24 19:19:45 · 2 answers · asked by Hema 2 in Computers & Internet Other - Computers

2 answers

for(int i=4;i>0;i--)
{
for(int j=i;j>0;j--)
System.out.print(*);
System.out.println();
}

for(int i=1;<4;i++)
{
for(int j=1;j<6;j++)
System.out.print(*);
System.out.println();
}

for(int i=0;i<4;i++)
{
for(int j=0;j<=i;j++)
System.out.print(*);
System.out.println();
}

2007-02-24 19:28:05 · answer #1 · answered by abd 5 · 0 1

hai you can c language for this.this can be generated by using ordinary concept of declaration and printf statements where you will have to use tab spaces for each of the asterik u use.jst try with ordinary printf statements.

2007-02-25 03:26:44 · answer #2 · answered by james bond000 2 · 0 1

fedest.com, questions and answers