KodeGod.com

027. Write a Program to print first n even numbers in C language

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