Monday, March 22, 2010

crops

Private sub command 1_click()
Dim a(1 to 10)as string
Dim i,j as integer
Dim t as string
n=inputbox("enter the total crops name")
For i = 1 To n
a(i)=inputbox("enter the total crops name one by one")

list1.additem a(i)
next i
for i=1 to n-1
for j=i+1 to n
if a(i)>a(j) then
t=a(i)
a(i)=a(j)
a(j)=t
end if
next j
next i
for i=1 to n
list2.additem a(i)
next i
text 1=a(n)
text 2=a(n-1)
text 3=a(1)
text 4=a(2)
end sub

No comments:

Post a Comment