Page 214 - CA_Blue( J )_Class10
P. 214
12 //Take row number and desired symbol from the user
13 for(i=1; i<=rows; i++)
14 {
15 for(j=rows; j>i; j--)
16 {
17 System.out.print(" ");
18 }
19 System.out.print(ch);
20 for(j=1; j<(i-1)*2; j++)
21 {
22 System.out.print(" ");
23 }
24 if(i==1)
25 {
26 System.out.print("\n");
27 }
28 else
29 {
30 System.out.print(ch+"\n");
31 }
32 }
33
34 for(i=rows-1; i>=1; i--)
35 {
36 for(j=rows; j>i; j--)
37 {
38 System.out.print(" ");
39 }
40 System.out.print(ch);
41 for(j=1; j<(i-1)*2; j++)
42 {
43 System.out.print(" ");
44 }
45 if(i==1)
46 {
212212 Touchpad Computer Applications-X

