Thursday, September 20, 2012

program to find the odd numbers up to a limit

count of odd numbers

#include<conio.h>
#include<stdio.h>
void main()
{
int n,count=0,i;
printf("Enter the limit\n");
scanf("%d",&n);
for(i=0;i<n;i++)
{
if(i%2!=0)
{printf("\n%d",i);
 count++;
}
}
getch();
}

No comments:

Post a Comment