C# logical operators && || 🔣

preview_player
Показать описание
C# logical operators && (AND) || (OR) tutorial example epxlained

#C# #logical #operators
Рекомендации по теме
Комментарии
Автор

using System;

namespace MyFirstProgram
{
class Program
{
static void Main(string[] args)
{

// logical operators = Can be used to check if more than 1 condition is true/false

// && (AND)
// || (OR)

Console.WriteLine("What's the temperature outside: (C)");
double temp =

if (temp >= 10 && temp <= 25)
{
Console.WriteLine("It's warm outside!");
}
else if (temp <= -50 || temp >= 50)
{
Console.WriteLine("DO NOT GO OUTSIDE!");
}


Console.ReadKey();
}
}
}

BroCodez
Автор

teacher: in 5 billion years the sun will explode.

8 year old me:

movieworld
Автор

yet another blessing I found a year to late

NotTheHeroStudios
Автор

you can also use "or" "and" instead of || && in c# 9

simon
Автор

how did u write the vertical lines?
I dont see em anywhaere on my keyboard!

alex.g
Автор

this is so confusing inside while loop for me.

krishnarai