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

Calendar in Asp.net

CheckBox in Asp.Net MVC (Insert Data of CheckBox in Database and GetData Of checkBox From DataBase)