repl.it
@SylvianBryan/

Nested Loop

C

No description

fork
loading
Files
  • main.c
  • main
main.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
/* Prototype B N01422856 Sylvian Bryan. 2019/04/10. This program pattern numbers follow by stars using various Loops.*/

#include <stdio.h>

/*void aster (int star);//function*/ 

int main(void) 
{
int first,second, third=3;


for (first=1; first<=1;++first)
printf("\n\n                     %d\n", first);//Number 1
  for (first=1;first<=1;++first)
  printf ("                   "); 
  printf ("  *\n\n"); 

for (first=2; first<=2;++first)
printf("             %d", first);// Number 2
printf("                  %d", first);
  for (first=2;first<=2;++first)
  printf ("                   \n"); 
  printf ("            * *                ***\n\n"); 
while (third <=3)
{
   printf(" %d",+ ++third);//Number 4
      printf("                    %d",+ ++third);//Number 5
       printf("                   %d\n",+ ++third);//Number 6
        printf ("****                *****               ******\n\n"); 
}   
return 0; 
}