vasanth krishna

vasanth krishna

  • NA
  • 44
  • 54.8k

c# program

Aug 31 2013 8:19 AM
i had write program for reverse the substring in a given string ex: 

I/P
tokona#%!
o/p
!%#tokona

i try this  code.....


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication8
{
    class Program
    {
        static void Main(string[] args)
        {
          
            string n = "tokonaA#*!";
            Console.WriteLine("{0}",n);
           
            int no=n.Length;
            int c = 0;

            
                char[] let = n.ToCharArray();
                for (int j = no - 1; j >= 0; j--)
                {
                    if (!char.IsLetter(let[j]))
                    {
                        Console.Write(let[j]);

                    }
                       
                        else if(char.IsLetter(let[j]))
                        {


                            Console.Write(let[j]);
                        }
                                              
              
            }
            Console.Write("{0}",c);
            Console.ReadLine();
        }
    }
}

but m not get the correct o/p..

so what change i want to do to get the correct o/p

Answers (2)