//C Program To Print Odd Numbers Between 1 To 100 Using For Loop
#include<stdio.h>
void main()
{
int i;
for(i=1;i<=100;i++)
{
if(i%2!=0)
{
printf("%d \n",i);
}
}
}
//C Program To Print Odd Numbers Between 1 To N
#include<stdio.h>
void main()
{
int i,n;
printf("Enter how many number you want \n");
scanf("%d",&n);
printf("Odd Numbers Between 1 to %d : \n",n);
for(i=1;i<=n;i++)
{
if(i%2!=0)
{
printf("%d \n",i);
}
}
}
Output
Enter how many number you want
10
Odd Numbers Between 1 to 10 :
1
3
5
7
9
C Program To Print Odd Numbers Between 1 To 100 Using Function
Algorithm
Program Start
Declare Variable
Calling Function
check condition
print result according to condition
Program End
Program
//<span style="font-size: inherit;">C Program To Print Odd Numbers Between 1 To 100 Using Function</span>
#include<stdio.h>
int main()
{
//Calling Funcrion
oddnumbers();
return 0;
}
void oddnumbers()
{ int i;
printf("Odd Numbers Between 1 to 100 : \n");
for(i=1;i<=100;i++)
{
if(i%2!=0)
{
printf("%d \n",i);
}
}
}
C Program To Print Odd Numbers Between 1 To 100
Algorithm
Program
Output
C Program To Print Odd Numbers Between 1 To N\
Program
Output
C Program To Print Odd Numbers Between 1 To 100 Using Function
Algorithm
Program
Output
need an explanation for this answer? contact us directly to get an explanation for this answer