Monday, March 23, 2009

Reverse the number

Reverse the number by using logics and loops, not using predefined functions... etc.,
Creating user defined function

' Reversing the Given Number...

Function Reverse(Num)

num_len= len(Num)

For i=0 to num_len-1

remi=Num mod 10
'msgbox remi

num=num\10
'msgbox num

val=val&remi
print val

'msgbox ubound(no)

Next

Reverse=val

End Function


Num=Inputbox("Enter your Number to reverse :")

Rev=Reverse(Num)

msgbox "Reversed Number is "&Rev


Thanks & Regards
Baba Fakruddin.D

No comments:

There was an error in this gadget