C# conditional operator ❓

preview_player
Показать описание
C# conditional ternary operator tutorial example explained

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

using System;

namespace MyFirstProgram
{
class Program
{
static void Main(string[] args)
{
// conditional operator = used in conditional assignment if a condition is true/false

//(condition) ? x : y

double temperature = 20;
String message;

message = (temperature >= 15) ? "It's warm outside!" : "It's cold outside!";

Console.WriteLine(message);

Console.ReadKey();
}
}
}

BroCodez
Автор

Very interesting, thanks for the video

alexiscoe
Автор

Awesome stuff dude! God bless you and Jesus loves you. I hope your channel takes off! You deserve it. Such quality and helpful content! Thank you for making these!

catescdc
Автор

As the guy who knows the basics of c++ and java, I always was writing something like
( temperature >= 15 )? message = “It’s warm outside!” : message = “It’s cold outside!”;
This is much more elegant and easier to read. Thanks bro

katanimaaaa
Автор

Cool Tutorial! So Clear and Easy To Understand .Thank You Bro ❤😘

ThilinaTharuphati
Автор

Amazing! i was scratching my head on how to use the conditional ternary operator correctly and why it didnt work, turns out you need to assign first a variable whom will recieve the value, just like you did! thanks!

LunarBulletDev
Автор

Thanks, man you explained it better than the other videos Amazing.

mohammedalmutairi
Автор

thanks, I searched everywhere but everyone was so fucking cryptic about it and it turns out it is just an if else lmao

joaquinillo_
Автор

lesson check😇
As a side note, this was the second video that had the likes at 69 before I came along. It hurts my soul to upset the force. lol

whitedinamo
Автор

ok fine but if you do it with readline state it would be better but late to understand

tanvirsahrierjishan