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.


#include<stdio.h>

int main() {
   //Statement
}

C Program to print first n odd numbers in descending order

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

#include<stdio.h>

int main() {

  int n, i, a;

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

  printf("List 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