5. Get value from user in C#.

 using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;


namespace GetValue.cs

{

    class Program

    {

        static void Main(string[] args)

        {

            int no;

            string nm;


            Console.Write("Enter Roll No. = ");

            no = Convert.ToInt32(Console.ReadLine());


            Console.Write("Enter Name = ");

            nm = Console.ReadLine();


            Console.WriteLine("Roll No is " + no);

            Console.WriteLine("Name is " + nm);       

            Console.Read();

        }

    }

}


Comments