C Program to print Even number series 2 4 6 8 ... N for the given value of N.
For example, if N=10, output should be
2 4 6 8 10
For example, if N=10, output should be
2 4 6 8 10
Program Code
#include<stdio.h>
int main()
{
int i, N;
printf("Enter N:");
scanf("%d", &N);
for(i=2; i<=N; i=i+2)
{
printf("%d ",i);
}
return 0;
}
Program Code
2 4 6 8 10
< Back to Home >
No comments:
Post a Comment