Monday, March 23, 2009

Biggest no. in given 10 digits

' Here is the code to identify Biggest no. in given 10 digits

' Identify Biggest no. in a given list

'********************************************** Called Function with an Array*******************************************************************

Function Biggest(a)

val2=a(9)
print val2
Big=val2

For i=0 to ubound(a)

val1=a(i)
print val1

If (val1>Big) Then

Big=val1

else

Big=biggest

End If

biggest=big

Next

'print "Biggest no. is ......................"&Big

End Function

'********************************************** End of Function *******************************************************************


Dim a

a=array(1,2,4,3,56,2,35,30,12,5) ' Assigning values to an Array "a"


'********************************************** Calling Function ******************************************************************

big=Biggest(a) 'Function calling with an array "a"

print "Biggest No. is "&big ' Printing Returned Value of Function

Thanks & Regards
Baba Fakruddin.D

No comments:

There was an error in this gadget