C Program to print even numbers in a Right angled Triangle pattern
Program
#include<stdio.h>
void main()
{
int i, j, rows, num = 2;
printf("Enter the number of rows to be printed:\t");
scanf("%d", &rows);
for (i = 0; i < rows; i++)
{
num = 2;
for (j = 0; j <= i; j++)
{
printf("%d\t", num);
num = num + 2;
}
printf("\n");
}
}
Output
Enter the number of rows to be printed: 6
2
2 4
2 4 6
2 4 6 8
2 4 6 8 10
2 4 6 8 10 12