IIf Demo : IIf « Language Basics « VB.Net






IIf Demo

IIf Demo
Imports System

public class MainClass
    Shared Sub Main()
         Dim valueOne As Integer = 10
         Dim valueTwo As Integer = 20
         Dim maxValue As Integer

         maxValue = CInt(IIf((valueOne > valueTwo), valueOne, valueTwo))

         Console.WriteLine("ValueOne: {0}, valueTwo: {1},  maxValue: {2}", _
           valueOne, valueTwo, maxValue)
    End Sub

End Class



           
       








Related examples in the same category