0% found this document useful (0 votes)
5 views2 pages

2amodule Module1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

2amodule Module1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

2amodule module1

Dim dataarray(9) as integer


Sub main()
Dataarray= {10, 5, 6, 7, 1, 12, 13, 15, 21, 8}

Console.WriteLine("origional array")
For count = 0 To 9
Console.WriteLine(dataarray(count))

Next

End sub

End module

2b(i)

Module Module1
Dim dataarray(9) As Integer
Sub Main()
dataarray = {10, 5, 6, 7, 1, 12, 13, 15, 21, 8}
Console.WriteLine("the array,")
For count = 0 To 9
Console.WriteLine(dataarray(count))
Next
Console.WriteLine("enter the search tem:")
Dim searchitem As Integer
Dim found As Boolean
If found Then
Console.WriteLine("search itemm found")
Else
Console.WriteLine(" search item not found")

End If
Console.ReadKey()

End Sub
Function linearsearch(numbers as integer(), searchnumber as boolean
For i = 0 To numbers.Length - 1
If numbers = searchnumber Then
Return True
End If
Next

Return False
End Function
End Module
2cModule Module1
Dim dataarray(9) As Integer
Sub Main()
dataarray = {10, (5, 6, 7, 1, 12, 13, 15, 21, 8}
Console.WriteLine("the array")
For count = 0 To 9
Console.WriteLine(dataarray(count))
Next

Dim swapped As Boolean

swapped = False
For i = 0 To numbers.length - 2
If numbers(i) < numbers(i + 1) Then
Dim temp = numbers(i)
numbers(i) = numbers(i + 1)
numbers(i + 1) = temp
swapped = True

End If
Next
loop until Not swapped
End Sub

End Module

Screenshot of 2b

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy