Skip to main content

Write a 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
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
MsgBox(sqr &" and"& StrReverse(str1))
End Class