Tech Study

Write C# program to print all natural numbers in reverse order

Introduction

I have used Visual Studio 2012 for debugging purpose. But you can use any version of visul studio as per your availability..

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
public class csharpExercise
{
    static void Main(string[] args)
    {
 
        int i, num;
 
        //Read a number from user
        Console.Write("Enter any number: ");
        num = Convert.ToInt32(Console.ReadLine());
 
        /*Running loop from the number entered by user,
          and Decrementing by 1*/
        for (i = num; i >= 1; i--)
        {
            Console.WriteLine("\n" +  i);
        }
 
        Console.ReadLine();
    }
}

Result

Write C# program to print all natural numbers in reverse order
Write C# program to print all natural numbers in reverse order

TaggedWrite C++ program to print all natural numbers in reverse order

Java Final keyword

Introduction : java final keyword The final keyword present in Java programming language is generally used for restricting the user. …

Read more

C++ Memory Management: new and delete

C++ Memory Management We know that arrays store contiguous and the same type of memory blocks, so memory is allocated …

Read more