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

slip no 8 
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim n As Integer
        Dim sqr As Double
        Dim rm As Integer
        Dim str1 As String
        n = CInt(TextBox1.Text)
        sqr = Math.Sqrt(n)
        While n
            rm = n Mod 2
            str1 = str1 & rm
            n = n \ 2
        End While
        MessageBox.Show("Square Roor :" & sqr & " Binary Number : " & str1)
        StrReverse(str1)
    End Sub
End Class

Comments

Post a Comment

Popular posts from this blog

Write a Vb.net program to accept a character from keyboard and check whether it is vowel or not. Also display the case of that character.

Write a Vb.net program to check whether entered string is palindrome or not.

Write a Vb.net program for blinking an image.