A C program to print ODD numbers from 1 to N using while loop.

October 14, 2018 - C Program, Computer


//A C program to print ODD numbers from 1 to N using while loop.

#include<stdio.h>
#include<conio.h>
void main()
{
int number=1,n;
printf("Enter the value of N: ");
scanf("%d",&n);
while(number<=n)
{
if(number%2 != 0)
printf("%d ",number);
number++;
}
getch();
}

Output:
A C program to print ODD numbers from 1 to N using while loop, my knowledge to you dude, write A C program to print ODD numbers from 1 to N using while loop