write a c program to display all odd numbers between 1 to n using 4 loop
Answers
Answered by
2
Answer:
#include <stdio.h>
int main()
{
int i, n;
printf("Enter the limit you want to get upto that: ");
scanf("%d", &n);
printf("Odd numbers from 1 to %d are: \n", n);
for(i=1; i<=n; i++)
{
if(i%2!=0)
{
printf("%d\n", i);
}
}
return 0;
}
Explanation:
Similar questions
Business Studies,
5 months ago
Social Sciences,
5 months ago
Math,
5 months ago
Physics,
11 months ago
Computer Science,
11 months ago
Social Sciences,
1 year ago
English,
1 year ago