Tech Study

Write a C# program to print individual characters of the string 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;
public class StringExercise
{
    public static void Main()
    {
        string str;
        int length = 0;
 
        Console.Write("Enter the string : ");
        str = Console.ReadLine();
 
        length  = str.Length - 1;
        Console.Write("The characters of the string in reverse are : \n");
        while (length >= 0)
        {
            Console.Write("{0} ", str[length]);
            length--;
        }
        Console.ReadLine();
    }
}

Result

Write a C# program to print individual characters of the string in reverse order
Write a C# program to print individual characters of the string in reverse order

TaggedWrite a C# program to print individual characters of the string 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