Answers for "c# ternary call function"

C#
7

c# ternary

// ---------------- Syntax of Ternary Operators ----------------- //

string stateOfMatter;
int temperature = 23;


// ---- For just one condition ---- //
stateOfMatter = temperature < 0 ? "Solid": "Liquid";
  
// If temperature is below zero, then stateOfMatter is solid, otherwise
// it will be liquid
  
  
// ---- For more conditions ---- //
stateOfMatter = temperature < 0 ? "Solid" : (temperature > 100 ? "Gas" : "Liquid");
Posted by: Guest on August-28-2020
0

c# ternary operation

condition ? consequent : alternative
Posted by: Guest on October-25-2020
1

c# ternary condition

condition ? consequent : alternative
Posted by: Guest on July-30-2020

C# Answers by Framework

Browse Popular Code Answers by Language