Sunday, October 23, 2011

Even Number Series

#include< stdio.h>
#include< conio.h>
void main( )
{
    int i,n;
    clrscr( );
    printf("Enter the range:");
    scanf("%d",&n);
    for(i=2;i<=n;i=i+2)
    {
        printf("%d",i);
    }
    getch( );
}

Output:-
Enter the range:10
2 4 6 8 10

No comments:

Post a Comment