C Program to print first n even numbers

Program

#include<stdio.h>
void main()
{
	int n, i;
	printf("Enter the value of n:\t");
	scanf("%d", &n);
	for(i = 1; i <= n; i++)
	{
		if((i %2) == 0)
		{
			printf("%d\t", i);
		}
	}
	printf("\n");
}

Output

Enter the value of n:	15
2	4	6	8	10	12	14