C Program to print first n odd numbers in descending order


In this program, You will learn how to print first n odd numbers in descending order in c.


List of odd numbers in descending order : 11 9 7 5 3 1


Example: How to print first n odd numbers in descending order in c

Run it Now
#include<stdio.h>

int main() {

   int n, i, a;

   printf("Enter a Number :");
   scanf("%d", &n);

   printf("\nList in Descending Order :");

   for (i = n - 1; i >= 0; i--) {
       a = 1 + i * 2;
       printf("%d ", a);
   }

   return 0;
}

Output:

Enter a Number :10
List in Descending Order :19 17 15 13 11 9 7 5 3 1