Even Number Pattern – C Program

Even Number Pattern – C Program

write a c program to display even number triangle patterns.

The number patterns should be like :

2
2  4
2  4  6
2  4  6  8
2  4  6  8  10

#include<stdio.h>
#include<coino.h>

void main()
{

 int i,j,k;
 for(i=1; i<=5; i++)
 {
   for(j=1,k=2; j<=i; j++,k=k+2)
     {     
        printf(" %d",k);
      }
   printf("\n");
 }

 getch();

}

The even number patterns c program output is:

2
2  4
2  4  6
2  4  6  8
2  4  6  8  10

 

Leave a Reply

Your email address will not be published. Required fields are marked *