Operator in C-sharp .Net

 namespace OperatorExample

{

    internal class Program

    {

        static void Main(string[] args)

        {

            //int a = 5, b=0;

            //b = a++;

            //b = ++a;

            //b = a--;

            //b = --a;

            //a += 5; //a = a + 5;

            //a *= 6; //b = b * 6;

            //Console.WriteLine("a={0} and b={1}", a, b);



            int a = 5, b = 2;

            String s = (a > 2) ? "a is greater" : "b is greater";

            Console.WriteLine(s);

        }

    }

}





Comments

Popular posts from this blog

Map, MapGet, MapPost, MapPut and MapDelete methods in ASP.NET Core MVC - Routing ASP.NET

Layout View In ASP.NET Core 6 | _Layout.cshtml ASP.NET | Master Page ASP.Net Core

Attribute Routing in ASP.NET Core MVC