Friday, 30 May 2014

Write a program to print even numbers from 1 to 50.

#include<stdio.h>

main()
{
    int i=1;
   
    printf("\nEven numbers from 1 to 50=");
   
    while(i<=50)
    {
        if(i%2==0)
            printf("%d ",i);
        i++;
    }
}

No comments:

Post a Comment