Hollow Hourglass printf in C

Hello, i'm new / bad at programming and I know the program is messy and all but I was just wondering if anyone knew how to make the two sloped lines intersect each other in my code to complete the hour glass as I have it. Thanks for any help. And I understand the mess just need the assignment complete thanks!

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
  printf("---------------------------------- Pattern 8\n"); // again I didn't know how to only use 1 set of *, "", and \n

	for (r = 0; r < 1 ; r++)
	{
		for (a = 0; a < 11; a++)
		{
			printf("*");
		}
		printf("\n");
	}
	
	for (r = 0; r < 9;r++)
	{
		for (s = -1; s < 1 * r;s++)
		{
			printf(" ");
		}
		for (a = 0; a < 1 ;a++)
		{
			printf("*");
		}
		printf("\n");

	}
	for (r = 0; r < 9;r++)
	{
		for (s = 0; s < 9 - 1 * r;s++)
		{
			printf(" ");
		}
		for (a = 0; a < 1;a++)
		{
			printf("*");
		}
		printf("\n");

	}
	for (r = 10; r < 11; r++)
	{
		for (a = 0; a < 11; a++)
		{
			printf("*");
		}
		printf("\n");
	}
r = row
s = space
a = asterisk
Topic archived. No new replies allowed.