C program to print n even numbers.

#include<stdio.h>
#include<conio.h>
int main()
{
    int n, i;
    printf("Enter the value of n(limit): ");
    scanf("%d", &n);
    printf("\nAll Even Numbers from 1 to %d:\n", N);
    for(i=1; i<=n; i++)
    {
        if(i%2 == 0)
            printf("%d ", i);
    }
    getch();
    return 0;
}
C program to print n even numbers. C program to print n even numbers. Reviewed by on December 22, 2019 Rating: 5

No comments:

Powered by Blogger.