A C program to print ODD numbers from 1 to N using for loop.
October 16, 2018 -
C Program, Computer
//A C program to print ODD numbers from 1 to N using for loop.
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n;
printf("Enter the value of N: ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
if(i%2 != 0)
printf("%d ",i);
}
getch();
}
Output:
