-->
Showing posts with label program for all even numbers. Show all posts
Showing posts with label program for all even numbers. Show all posts

hseb sol17:program to get all even numbers lying between 1 and 100

//program  to print/display all even numbers lying between 1 and 100.
#include<stdio.h>
#include<conio.h>
void main()
{
int k,n;
printf("enter value of 'n'\n");
scanf("%d",&n);
for(k=1;k<=n;k++)
   {
     if(k%2==0)
      {      printf("%d,",k);
      }
  }
getch();
}