Friday, 5 August 2016

2-Reading and Writing to Console in C# || Urdu

Reading & Writing to Console 


•Writing to the Console.
•Reading from Console
• Two ways of Writing to the Console
–Concatenation

–Place Holder Syntax- most preferred 

 Example of –Place Holder Syntax- most preferred 


using System;

    class Program
    {
       
        static void Main()
        {
            Console.WriteLine("what is your First Name ?");
            string FirstName = Console.ReadLine();

            Console.WriteLine("what is your Last Name ?");
            string LastName = Console.ReadLine();
         
            Console.WriteLine("Your Name is {0}, {1} ", FirstName, LastName);

        }
    }

No comments:

Post a Comment