STRING REVERSE
Dim Str
Str="Quick
Test Professional"
Rstr=""
For i = Len(Str) To 1 Step -1
Rstr=Rstr&Mid(Str,i,1)
Next
msgbox Rstr
STRING PALINDROME
Dim Str
Str="MadaM"
Rstr=""
For i = Len(Str) To 1 Step -1
Rstr=Rstr&Mid(Str,i,1)
Next
msgbox Rstr
If Str=Rstr Then
msgbox "Palindrome"
Else
msgbox "Not Palindrome"
End If
STRING SWAPPING
Str1="Quick"
Str2="Test"
Msgbox "Str1::"&Str1
Msgbox "Str2::"&Str2
l1=Len(Str1)
l2=Len(Str2)
Str1=Str1&Str2
Str2=Mid(Str1,1,l1)
Str1=Mid(Str1,l1+1,l2)
Msgbox "Str1::"&Str1
Msgbox "Str2::"&Str2
PRIME NUMBER
LISTING
'Prime Number Listing
l=15
For i = 1 To l Step 1
count=0
For j = 2 To l Step 1
If i mod j=0 Then
count=count+1
End If
Next
If count =1 Then
msgbox i&" is Prime
Number"
Else
msgbox i&" is not Prime Number"
End If
Next
No comments:
Post a Comment