-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask 10.VB
More file actions
36 lines (29 loc) · 835 Bytes
/
task 10.VB
File metadata and controls
36 lines (29 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Module Module1
Sub Main()
Dim mystr1, mystr2, B, mystr3 As String
Dim mychar1 As Char
Dim i, a As Integer
B = ""
a = 0
mystr3 = "ly"
mystr1 = ""
mychar1 = ""
mystr2 = "ing"
i = 0
Console.Write("Please enter string: ")
mystr1 = Console.ReadLine()
a = Len(mystr1)
B = Right(mystr1, 3)
If a >= 3 And B <> mystr2 Then
Console.WriteLine("result is: " & mystr1 & mystr2)
Console.ReadKey()
ElseIf a >= 3 And B = mystr2 Then
Console.WriteLine("result is: " & mystr1 & mystr3)
Console.ReadKey()
Else
mystr1 = mystr1
Console.WriteLine("result is:" & mystr1)
Console.ReadKey()
End If
End Sub
End Module