Tech Study

Write C# program to find reverse of an array

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;
class Program
{   
    static void Main()
    {      
 
 
        int[] array = new int[100];
        int size, i;      
 
 
        //Reads size of the array
        Console.WriteLine("Enter size of the array: ");
        size = Convert.ToInt32(Console.ReadLine());
 
        //Reads elements in array
        Console.WriteLine("Enter elements in array: ");
        for (i = 0; i < size; i++)
        {
            array[i] = Convert.ToInt32(Console.ReadLine());           
        }
 
        //Print array in reversed order
        Console.WriteLine("\nArray in reverse order: ");
        for (i = size - 1; i >= 0; i--)
        {
            Console.Write("\t"+ array[i]);
        } 
 
        Console.ReadLine();
    }
 
}

Result

Write C# program to find reverse of an array
Write C# program to find reverse of an array

TaggedWrite C program to find reverse of an array

Python Examples

Introduction: Python Examples are the basic programming concepts of python like python syntax,python data types,,python operators,python if else,python comments etc.. …

Read more

C String Functions

C String Functions perform certain operations, It provides many useful string functions which can come into action. The <string.h> header …

Read more