Skip to main content

Write a Vb.net program to accept number from user into the TextBox.Calculate the square root of that number also convert the entered number into binary number and display result into the Message Box

· One min read
Kaustubh Kulkarni
file.vb
PublicClass Form1  
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim no AsInteger
Dim sqr AsDouble
Dim rm AsInteger
Dim str1 AsString
no = CInt(TextBox1.Text)
sqr = Math.Sqrt(no)
While no
rm = no Mod 2
str1 = str1 & rm
no = no 2
EndWhile
MsgBox(sqr &" and"& StrReverse(str1))
EndSub
End Class