C programming examples with output
Even number upto a range
Program
#include<stdio.h>
#include<conio.h>
main()
{
int a,b;
clrscr();
printf("Enter the range: ");
scanf("%d",&a);
b=1;
while(b<=a)
{
if(b%2==0)
printf("%d/t",b);
b++;
}
getch();
}
Output
Enter the range:10
2 4 4 8 10
Check others programming by click here:
0 komentar:
Post a Comment