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.


#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:

A C program to print ODD numbers from 1 to N using for loop, write A C program to print ODD numbers from 1 to N using for loop, my knowledge to you dude, c programming example,









Nhận xét