You are on page 1of 1

Anagram Input: Two words word1 and word2 Output: The two words are or are not anagrams

word1 <- first string

For I = 0 to N - 2 For J = 0 to N - 2 If (A(J) > A(J + 1) Temp = A(J) A(J) = A(J + 1) A(J + 1) = Temp End-If End-For End-For

dim intX as integer = textbox1.text

word2 <- second string sort word1 and word2 alphabetically if word1 = word2 then return anagram else return not anagram
Private Sub Cmdrandom_Click() For i = 0 To 9 Randomize Txtrandom.Text = Format(((Rnd(i) * 1000) + 1), "0") Next i
dim intX as string= textbox1.text
for Counter1 as integer = 1 to intX for Counter2 as integer = 1 to Counter1 textbox2.text = textbox2.text + Counter1 next textbox2.text = textbox2.text + vbCrLf next

End Sub
textbox2.text = hex(textbox1.text)

PALINDROME 1. Convert the number to a string. 2. If string length is less than 2, it's a palindrome, done. 3. If first character is not equal to last character, it's not a palindrome, done. 4. Chop off the first and last characters 5. Go to step 2.

Suppose A is an array of N values. We want to sort A in ascending order.

You might also like