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();
}
#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