“operator bersyarat?:” Kode Jawaban

Operator bersyarat

if (x === 5 || x === 7 || x === 10 ||x === 20) {
  // run my code
}
Outrageous Osprey

operator bersyarat?:

condition ? consequent : alternative

var rand = new Random();
var condition = rand.NextDouble() > 0.5;

var x = condition ? 12 : (int?)null;

https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/conditional-operator
Victorious Vulture

Operator bersyarat

bCondition1 && bCondition2
Outrageous Osprey

Jawaban yang mirip dengan “operator bersyarat?:”

Pertanyaan yang mirip dengan “operator bersyarat?:”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya