//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 Program to find odd or even.
// A Program to add two numbers.
// A program to display series from 1 to 50.
// A program to find the person is eligible for voting or not.
//A C program to find largest number among 3.
// A C program to perform arithmetic operations using switch case.
// A Program to add two numbers.
// A program to display series from 1 to 50.
// A program to find the person is eligible for voting or not.
//A C program to find largest number among 3.
// A C program to perform arithmetic operations using switch case.
// A program to print the name 10 times.
//A C program to print ODD numbers from 1 to N using for loop.
//A C program to print ODD numbers from 1 to N using for loop.
0 Comments