C Program to print first n odd 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:	12
1	3	5	7	9	11