C# Block Statement({})

In this chapter you will learn:
  • What is Block Statement in C#?
  • How to use Block Statement in C#?

The block statement is used to write multiple segments of the program in the logical group.

Example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace run_csharp_code
{ //Begin Statement
    class Program
    { // Begin Statement
        static void Main(string[] args)
        { //Begin Statement
            int num1, power;
            num1 = 5;
            power = num1 * num1;
            Console.WriteLine(power);
            Console.ReadLine();
        } // End Statement
    } // End Statement
} // End Statement

Summary

In this chapter you learned what is block statement in C#. In next chapter you will learn Empty statement in C#.

More Articles

 

Share your thought



PLEASE DISABLE ADBLOCKER AND SUPPORT US!

Please support us by enabling ads on this page. Refresh

YOU DON'T LIKE ADS, WE ALSO DON'T LIKE ADS!
 
But we have to show ads on our site to keep it free and updated. We have to pay huge server costs, domain costs, CDN Costs, Developer Costs, Electricity and Internet Bill. Your little contribution will encourage us to regularly update this site.