Skip to main content

C Program to print the first N even numbers in reverse order.

 C Program to print the first N even numbers in reverse order.

    In this example, we will print the first N even numbers in reverse order. Here N is the total number of even numbers you want to print.



PROGRAM TO PRINT THE FIRST N EVEN NUMBERS IN REVERSE ORDER:

#include<stdio.h>
#include<conio.h>
int main()
{
    int even,n,i;
    printf("Enter the value of N : ");
    scanf("%d",&n);
    printf("Printing first %d even numbers in reverse order : ",n);
    for(i=n*2;i>2;i--)
    {
        if(i%2==0)
        {
            printf("%d\t",i);
        }
    }
    return 0;
}


OUTPUT TO PRINT THE FIRST N EVEN NATURAL NUMBERS IN REVERSE ORDER:

Enter the value of N : 10

Printing first 10 even numbers in reverse order : 20    18      16      14      12      10      8       6       4    


NOTE: You Can Comment Your Code if you have solved differently and we will pin it in the comment section.  Let's Learn together. 


MOTTO: 

                    You Learn, I Learn together We Learn. 



Comments

Popular posts from this blog

C Program to Print first N Even Natural Number/in Reverse Order

  C Program to Print first N Even Natural Number.     In this example, we will find and print the first N even natural. Here we have used for loop to solve this program.      What are Natural Numbers? Natural Numbers are all positive numbers starting from 1 to infinity.      For Example:  1,2,3,4,5,6,.............................,n are all natural numbers. What are Even Numbers? Even numbers are those numbers whose remainder is 0 when divided by 2.     For Example: 2,4,6,8,10,.....,n are all even numbers.   PROGRAM: #include <stdio.h> #include <conio.h> void   main () {      int   i , x ;      printf ( "Enter the value of N : " );      scanf ( " %d " ,& x );      for ( i = 1 ; i <= x ; i ++)     {          printf ( " %d " , 2 * i );     }      getch (); } OUTPUT: C Program to Print First N Even Natural Number in Reverse Order. PROGRAM 123 #include <conio.h> #include <stdio.h> int   main () {      int   i , x ;      printf