The first line will contain a message prompt to input the integer.
The succeeding lines contain the odd numbers.
Enter·n:·10
9
7
5
3
1
#include <stdio.h>
int main()
{
int n;
printf("Enter n: ");
scanf("%d", &n);
while(n > 0) {
if (n % 2 == 1)
printf("%d\n", n);
n--;
}
return 0;
}
Comments
Leave a comment