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


//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










Post a Comment

0 Comments