.Net Practical 1

Practical : 1
Subject : .Net

Aim : C# code to prompt a user to input his/her name and country name and then the output will "Hello user_name from Country_name"

Source Code :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace pr008
{
    class Class1
    {
        static void Main(string[] ar)
        {
            Console.Write("Enter your name : ");
            string name = Console.ReadLine();
            Console.Write("Enter your Country Name : ");
            string county = Console.ReadLine();
            Console.Write("Hello " + name + " from " + county);
            Console.Read();

        }
    }
}
Output:

Pratik Boghani

Author & Editor

Life is all about the next step.

0 comments:

Post a Comment