concept:
we have to print 1 to 100 odd numbers so first, we use a loop from 1 to 100. and then we use the if condition to print the odd numbers
below is the code
//write a C program to print all odd numbers from 1 to 100.
#include<stdio.h>
#include<conio.h>
void main()
{
int i;
clrscr();
for(i=1;i<=100;i++)
{
if(i%2!=0)
{
printf("%d,",i);
}
}
getch();
}
0 Comments
if you have any doubt, plz let me know