Convert integer to string in C#

In this article we will discuss about how to convert integer to string in C#.
  • 4857

Here we are converting integer into string. For this we will use ToString() method. Here two string variable have been taken and have been converted into string using ToString() method.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication5
{
    class Program
    {
        static void Main(string[] args)
        {
            String number;
            String mynumber;
            int x = 10;
            number = x.ToString();
            int y = 20;
            mynumber = y.ToString();
            Console.WriteLine(number + " " + mynumber);
            Console.ReadLine();
        }
    }
}
 

 

 
Further Readings
  
You may also want to read these related articles.

Ask Your Question

Got a programming related question? You may want to post your question here

Categories

More Articles

© 2018 DotNetHeaven. All rights reserved.