-
Notifications
You must be signed in to change notification settings - Fork 10
/
Star Pattern5.c
53 lines (42 loc) · 866 Bytes
/
Star Pattern5.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//******************************************************************
//Author: Abhishek Tiwari
//Date :- 21st October 2019
//Language : C Language
//About: Star Pattern
//******************************************************************
// ////////////////////////////////////////////////////////////////
/*
*
*A*
*A*A*
*A*A*A*
*A*A*A*A*
*A*A*A*A*A*
*A*A*A*A*A*A*
*/
// ///////////////////////////////////////////////////////////////////
#include<stdio.h>
int main()
{
int n = 7, c, k, space, count = 1;
//scanf("%d", &n);
space = n;
for (c = 1; c <= n; c++)
{
for (k = 1; k < space; k++)
printf(" ");
for (k = 1; k <= c; k++)
{
printf("*");
if (c > 1 && count < c)
{
printf("A");
count++;
}
}
printf("\n");
space--;
count = 1;
}
return 0;
}