Showing posts with label csharp-tutorial. Show all posts
Showing posts with label csharp-tutorial. Show all posts

Saturday, November 24, 2018

পার্ট 2 - C# টিউটোরিয়াল - Reading and writing to a console

Suggested Articles
Part 1 - Introduction to C#

আমরা এই আর্টিকেলে একটা demo program এর মাধ্যমে দেখবো -

1. console এর সাহায্যে কিভাবে read করা হয়
2. console এর সাহায্যে কিভাবে write করা হয়
3. console এ write করার দুইটা way আছে-
                           a) Concatenation
                           b) Placeholder syntax – Most preferred

Demo Code-
using System;
class Program
{
    static void Main()
    {
        // Prompt the user for his name
        Console.WriteLine("Please enter your name");

        // Read the name from console
        string UserName = Console.ReadLine();

        // Concatenate name with hello word and print
        Console.WriteLine("Hello " + UserName);

        //Placeholder syntax to print name with hello word 
        //Console.WriteLine("Hello {0}", UserName);
    }
}

N.B: C# কিন্তু একটা case sensitive language



পার্ট 2 - C# টিউটোরিয়াল - Reading and writing to a console




Sunday, November 18, 2018

পার্ট 1 - C# টিউটোরিয়াল - Introduction

এই আর্টিকেলে -
1. c# program এর basic structure শিখবো। আমরা এই নিচের program টা example হিসেবে use করবো

// Namespace Declaration
using System;

class Programs
{
    public static void Main()
    {
        // Write to console
        Console.WriteLine ("Welcome to C# Tutorial!");
    }
}

2. using System declaration এর purpose কি - using System নামের এই namespace declaration টা indicate করে যে আপনি System নামের namespace টা use করছেন। আপনি যদি using System, declaration টা omit করে দেন তাহলে আপনাকে Console class এর fully qualified name লিখতে হবে।আসলে এই namespace কিছু classes, interfaces, structs, enums এবং delegates এর collection, এবং এই namespace ব্যাবহার করা হয় আপনার code কে organize করার জন্য। আমরা পরবর্তী session গুলোতে namespaces নিয়ে details আলোচনা করবো।

3. Main() method এর purpose কি - এই Main method হল আপনার application এ ঢোঁকার entry point।


পার্ট 1 - C# টিউটোরিয়াল - Introduction