Illustrates the use of the ternary operator
/*
Mastering Visual C# .NET
by Jason Price, Mike Gunderloy
Publisher: Sybex;
ISBN: 0782129110
*/
/*
Example3_5.cs illustrates the use of
the ternary operator
*/
public class Example3_5
{
public static void Main()
{
int result;
result = 10 > 1 ? 20 : 10;
System.Console.WriteLine("result = " + result);
result = 10 < 1 ? 20 : 10;
System.Console.WriteLine("result = " + result);
}
}
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
-
-
-
-
-
-
|