Semester : S1 and S2
Subject : Computer Programming
Year : 2017
Term : DECEMBER
Branch : BIOTECHNOLOGY
Scheme : 2015 Full Time
Course Code : CS 100
Page:12
getch ();
Eg: program to display even numbers &odd numbers from 1 ton
void main ()
drscr();
printf("enter the values of n");
scanf("%d", &n);
printf("even numbers from 1 to %d ", n);
while(i<=n)
{
if(i%2==0)
printf("%d \t",
i);
i++;
}
printf("odd numbers from 1to %d ", n);
i=1;
while(i<=n)
{
if(i%2==1)
printf("%d\t",
i);
i++;
}
getch();