0% found this document useful (0 votes)
8 views

#Patterns

Patterns
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

#Patterns

Patterns
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

14:26 0.

09 Xe4l
KB/S 0

Coding C RUN MENU


Auto saved at 14:26:14

1 #include <stdio.h>
2 Void main()
3f
4 int i,j,k;
5 int star=4;
6
7 printf("\n");
8
9 for(i=1;i<=star; i++)
10
11 for (j-i;j<star;j++)
12
13 printf(" ");
14
15
16 for (k-1;k<=i;k++)
17
18 printf("*") ;
19
20 printf ("\n");
21
22
23
24
25
26
27
28
29
30

Tab

&

4
14:26

Compile Result
23:27 209 Xe4l.l 63)

Coding C RUN MENU


Auto saved at 23:26:53

1//201Prathamesh
2 #include<s tdio.h>
3 main()
4
5 int i,j,num,k, count=0;
6
7 printf("Enter number of rows\n")
8 scanf("%d" , &num);
9
10 for(i=num; i>=1;i--)
11
12 for (k=1;k<=count;k++)
13 fprintf(" ");
14
15 for(j=1;j<=i;j++)
16 printf("*");
17
18
19 printf("\n");
20
21 count++
22
23
24
25

Tab
&
23:27

Compile Result

Enter number of rows


4
****

**

**

[Process completed press Enter]

1 2 3 45 6 7 89 0

W e u

a Sd f 9h k

zx V b n m

2123 English
23:36 99XE 4l.

Coding C RUN MENU


Auto saved at 23:36:22

1//201Prathamesh
2 #include<stdio.h>
3 Void main()
4
5 int i,j,k=0,space=1, rows;
6
7 printf("Enter number of rows\n");
8 scanf("%d" , &rows);
9
10 for(i=rows; i>=1;i--)
11 {
12
13
for(j=1:j<=i;j+*)
14 printf("*");
15
16 if(il=rows)
17
18 for(k=1;k<=space;k++)
19
20 printf(" ");
21
22 space+=2;
23
24
25
26 for(j-i;j>=1:j--)
27
28 if(j!=rows)
29 printf("*");
30
31
32
printf("\n");
33
34 printf("\n") :
35
36}
37
38
39
40
41

Tab

&

O
23:35 0.00 y4
KB/S 6D

Compile Result

Enter number of rows


4
*******

** **

** **

* *

[Process completed (code 10) - pres

s Enter1

1 2 3 4 5 6 7 89 0

W e
r t yuoP
a Sd f 9 h jk

x V b n m

2123 English
23:43

Coding C RUN MENU


Auto saved at 23:43:27

1//201-Prathamesh
2 #include<stdio.h>
3 Void main ( )
4
5 int i,j.k=0,space=1,size;
6
printf("Enter size \n") ;
8 Scanf("%d",&size) ;
9
10for (i=size; i>=1 ;i--)
11
12 for(j=1;j<=i;jt+)
13
14 printf("*");
15
16 if(i! =size)
17 {
18
19
for (k=1;k<=space;k++) |
20 printf(""):
21
22 space+=2 ;
23

24
25

26for (j=i;j>=1;j--)
27
28 if(j!=size)
29 printf("*");
30
31
32 printf("\n") :
33}
34
35 space-=4;
36for (i=2;i<=size;i++)
37
38 for(j=1:j<=i;j++)
39
40 printf("*");
41
42 if(il =size)
43 {
44 for (k=1; k<=space; k++)
45
46
printf("");
47
48 space-2;
49
50}
51
52 for(j=i:j>=1:j--)
53
54 if(j!=size)
55 printf("*") ;
56
57 printf("\n") ;
58
59
60
61
62
63
64

Tab

O
23:43

Compile Result

Enter size
3
*****

****

****

****

[Process completed (code 3) press


Enter]

1 2 3 45 6 7 89 00

W e u o

a Sd h jk

zx V b n m

123 English

You might also like