LINQ AND OR Operators in C# (In Hindi)



OR Operator

int[] Age = { 20, 32, 45, 60, 90, 10, 5 };

            var res = from no in Age

                      where no > 20 || no % 2 == 0

                      select no;

            foreach (var item in res)

            {

                Response.Write(item + "</br>");

            }



  return View();



And Operator

int[] Age = { 20, 32, 45, 60, 90, 10, 5 };

            var res = from no in Age

                      where no > 20  &&  no % 2 == 0

                      select no;

            foreach (var item in res)

            {

                Response.Write(item + "</br>");

            }



  return View();










Comments

Popular posts from this blog

Search Record From Table Using jQuery in Asp.net core MVC

How To insert Radio Button Data in DataBase -- MVC

Toolbox Webparts Controls