BASIC Module Module2 Sub main() Dim x As Integer = -20 If x >= 1 Or 0 Then Console.WriteLine("number iz positive") Else Console.WriteLine("number iz negetive") End If Console.ReadLine() End Sub End Module --------------------------------------------- concrate_operator_and Module Module1 Sub Main() Dim fnm As String = "indrajit" Dim lnm As String = "chawda" Dim fullname1 As String fullname1 = fnm & " " & lnm Console.WriteLine("full name ::" & fullname1) Console.ReadLine() End Sub End Module ------------------------------------------- IF_ELSE Module Module3 Sub main() Dim no1 As Integer = 22 Dim no2 As Integer = 8 Dim no3 As Integer = 544 If no1 > no2 Then If no1 > no3 Then Console.WriteLine("no1 is max") Else Console.WriteLine("no3 iz max") End If Else If no2 > no3 Then Console.WriteLine("no2 iz max") Else Console.WriteLine("no3 iz max") End If End If Console.ReadLine() End Sub End Module ////////////////////////////or or or by use of and Module Module4 Sub main() Dim a As Integer = 1133 Dim b As Integer = 12 Dim c As Integer = 13 If a > b And a > c Then Console.WriteLine(" a is max") ElseIf b > c Then Console.WriteLine(" b is max") Else Console.WriteLine(" c is max") End If Console.ReadLine() End Sub End Module /////////////////////////// Module Module5 Sub main() Dim per As Double If per > 70 Then Console.WriteLine("A") ElseIf per > 60 Then Console.WriteLine("b") ElseIf per > 50 Then Console.WriteLine("c") ElseIf per > 40 Then Console.WriteLine("d") Else Console.WriteLine("fail") End If Console.ReadLine() End Sub End Module -------------------------------------------- date and time finder Module Module1 Sub main() Dim dd As Integer dd = findage() console.writeline("year: = " & dd) console.readline() End Sub Function findage() As Integer Dim dob As Date = #8/7/1992# Dim dt As Date = Now Dim year As Integer year = DateDiff(DateInterval.Year, dob, dt) Return year End Function End Module ------------------------------------- for exception related Module Module1 Sub Main() Try Dim no1 As Integer Dim no2 As Integer Dim ans As Integer Dim a(3) As Integer Console.WriteLine("i m in try") 'a(4) = 100 Console.Write("enter no 1") no1 = Console.ReadLine Console.Write("ente no 2") no2 = Console.ReadLine ans = no1 / no2 Console.WriteLine("answer = " & ans) Catch ex As IndexOutOfRangeException Console.WriteLine("array" & ex.Message) Catch ex As OverflowException Console.WriteLine("/0" & ex.Message) Catch ex As InvalidCastException Console.WriteLine("cast" & ex.Message) Catch ex As Exception Console.WriteLine("other" & ex.Message) End Try Console.ReadLine() End Sub End Module &&& ---- Module Module1 Sub Main() Try Dim no1 As Integer Dim no2 As Integer Dim ans As Integer Dim a(3) As Integer Console.WriteLine("i m in try") 'a(4) = 100 Console.Write("enter no 1::") no1 = Console.ReadLine Console.Write("ente no 2::") no2 = Console.ReadLine ans = no1 / no2 Console.WriteLine("answer = " & ans) Catch ex As IndexOutOfRangeException Console.WriteLine("array" & ex.Message) Catch ex As OverflowException Console.WriteLine("/0" & ex.Message) Catch ex As InvalidCastException Console.WriteLine("cast" & ex.Message) Catch ex As Exception Console.WriteLine("other" & ex.Message) Finally Console.WriteLine("m not here") End Try Console.ReadLine() End Sub End Module ----------------------------------------------------