Posts

Showing posts from June 2, 2020

Write VB program to swap the contents of variables using Pass by reference.

Image
Write VB program to swap the contents of variables using Pass by reference. Private Sub Command1_Click() Dim A As Integer Dim B As Integer A = InputBox("Enter 1st Number") B = InputBox("Enter 2nd Number") Print "Before Swap A = " & A &"   B = " & B Call Swap(A, B) Print "After Swap A = " & A &"   B = " & B End Sub Sub Swap(ByRef X As Integer, ByRef Y As Integer) Dim Temp As Integer Temp = X X = Y Y = Temp End Sub

Write VB program to find octal , hexadecimal , binary of given decimal number.

Image
Write VB program to find octal , hexadecimal , binary of given decimal number. Private Sub OptBin_Click() Dim N As Single Text2.Text = "" N = Text1.Text While N > 0 R = N Mod 2 Text2.Text = Text2.Text & R N = Int(N / 2) Wend Text2.Text = StrReverse(Text2) End Sub Private Sub Form_Load() Text1 = "" End Sub Private Sub OptHexa_Click() Text2.Text = Hex(Text1.Text) End Sub Private Sub OptOctal_Click() Text2.Text = Oct(Text1.Text) End Sub

Write VB program to find multiplication table using dynamic array

Image
Write VB program to find multiplication table using dynamic array Private Sub Command1_Click() Dim A() As Integer Dim N As Integer Dim K As Integer N = InputBox("Enter a Number") K = InputBox("Enter Upto What Print") ReDimA(K) For I = 1 To K A(I) = N * I Next I For I = 1 To K     Print N & " * " & I & " = " &A(I) Next I End Sub

Write VB program to find multiplication table using dynamic array & Preserve keyword.

Image
Write VB program to find multiplication table using dynamic array & Preserve keyword. Private Sub Command1_Click() Dim A() As Integer 'Empty array Dim I As Integer Dim N As Integer Dim K As Integer ReDimA(5) N = InputBox("Enter a Number") For I = 1 To 5 A(I) = N * I Next I K = InputBox("Enter Upto What Print") ReDim Preserve A(K) For I = 6 To K A(I) = N * I Next I For I = 1 To K     Print N & " * " & I & " = " &A(I) Next I End Sub

Write VB program to convert entered text in bold , italic , underline.

Image
Write VB program to convert entered text in bold , italic , underline. Private Sub ChkBold_Click() If ChkBold.Value = 1 Then     Text1.FontBold = True Else     Text1.FontBold = False End If End Sub   Private Sub ChkItalic_Click() If ChkItalic.Value = 1 Then     Text1.FontItalic = True Else     Text1.FontItalic = False End If End Sub   Private Sub ChkUnderline_Click() If ChkUnderline.Value = 1 Then     Text1.FontUnderline = True Else     Text1.FontUnderline = False End If End Sub

Write VB program to convert give number into word format.

Image
Write VB program to convert   give number into word format. Private Sub Command1_Click() Dim Word(10) As String * 6 Dim L As Integer Dim I As Integer Dim N As Integer Word(0) = "Zero" Word(1) = "One" Word(2) = "Two" Word(3) = "Three" Word(4) = "Four" Word(5) = "Five" Word(6) = "Six" Word(7) = "Seven" Word(8) = "Eight" Word(9) = "Nine" L = Len(Text1) For I = 1 To L     N = Val(Mid(Text1, I, 1))     Label3 = Label3 &Word(N) Next I End Sub  

Write VB program to check inputed string is palindrome or not.

Image
Write VB program to check inputed string is palindrome or not.   Private Sub Command1_Click() Dim S As String Dim T As String S = Trim(UCase(InputBox("Enter a String"))) T = S S = StrReverse(S) If S = T Then     Print "String is Palindrome" Else     Print "String is Not Palindrome" End If End Sub

Write VB program that moves image left or right using click event.

Image
Write VB program that moves image left or right using click event. Private Sub CmdLeft_Click() Label1 = Image1.Left If Image1.Left <= 0 Then     Image1.Left = 0 Else     Image1.Left = Image1.Left - 5 End If End Sub   Private Sub CmdRight_Click() Label1 = Image1.Left If Image1.Left >= 5000 Then     Image1.Left = 5000 Else     Image1.Left = Image1.Left + 500 End If   End Sub

Write VB program that counts no of characters & no of words entered in textbox.

Image
Write VB program that counts no of characters & no of words entered in textbox. Private Sub Command1_Click() Dim str As String Dim intCharacters As Integer Dim intWord As Integer Dim char As String * 1 Dim I As Integer str = Text1 intCharacters = Len(str) For I = 1 TointCharacters DoEvents char = Mid(str, I, 1) If char = " " Then intWord = intWord + 1 End If Next I Label4 = intCharacters Label5 = intWord + 1 End Sub

Write VB program that collect marks for five different subjects & total.

Image
Write VB program that collect marks for five different subjects & total.   Private Sub Command1_Click() Dim S1 As Integer Dim S2 As Integer Dim S3 As Integer Dim Total As Integer S1 = Val(Text1.Text) S2 = Val(Text2.Text) S3 = Val(Text3.Text) Total = S1 + S2 + S3 If Total >= 200 Then MsgBox "U R Allowed" Else MsgBox "U R Not Allowed"     End If End Sub

Write a program to Print the result of student with total marks and percentage.

Image
Write a program to Print the result of     student with total marks and   percentage.   Public Class Form1 Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click         TextBox4.Text = Val(TextBox1.Text) + Val(TextBox2.Text) + Val(TextBox3.Text)     End Sub   Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click         TextBox5.Text = Val(TextBox4.Text) * 100 / 300     End Sub   Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click         If Val(TextBox5.Text) >= 80 Then             TextBox6.Text = "Merit"         ElseIf Val(TextBox5.Text) >= 60 And Val(TextBox5.Text < 80) Then             TextBox6.Text = "first division"         ElseIf Val(TextBox5.Text) >= 50 And Val(TextBox5.Text) < 60 Then             TextBox6.Text = "Second division"         ElseIf Val(TextBox5.Text) >= 40 And Val(TextBox5.Text) < 50 Then        

Write a Program to perform all arithmetic operation

Image
Write a Program to perform all arithmetic operation.   Public Class Form1       Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click         TextBox3.Text = Val(TextBox1.Text) + Val(TextBox2.Text)       End Sub       Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click         TextBox3.Text = Val(TextBox1.Text) - Val(TextBox2.Text)     End Sub       Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click          TextBox3.Text = Val(TextBox1.Text) * Val(TextBox2.Text)     End Sub       Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click         TextBox3.Text = Val(TextBox1.Text) / Val(TextBox2.Text)     End Sub End Class

Write a program to create a menu to perform arthimetic operations using menu control array.

Image
Write a program to create a menu to perform arthimetic operations using menu control array. Private Sub MnuCal_Array_Click(Index As Integer) Dim a As Single Dim b As Single Dim c As Single a = InputBox("Enter 1st number") b = InputBox("Enter 2nd number") Select Case Index Case 0     c = a + b Case 1     c = a - b Case 2     c = a * b Case 3     c = a / b End Select MsgBox "Result "& c End Sub

Write a Program to calculate the salary of employee.

Image
Write a Program to calculate the salary of employee.   Public Class Form1       Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load       End Sub       Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged         TextBox2.Text = (40 * Val(TextBox1.Text) / 100)         TextBox3.Text = (15 * Val(TextBox1.Text) / 100)         TextBox4.Text = (10 * Val(TextBox1.Text) / 100)         TextBox5.Text = (20 * Val(TextBox1.Text) / 100)         TextBox6.Text = Val(TextBox1.Text) + Val(TextBox2.Text) + Val(TextBox3.Text) + Val(TextBox4.Text)         End Sub End Class _____________________________________________________________________________

Write HTML code to create following table.

Image
Write HTML code to create following table. Make Capacity Surya MYscore    40 W 10:00 10:50    60 W 11:00 11:25    100 W 12:00 12:50             <!DOCTYPE html> <html> <head> <title>Create Table</title>                       </head> <body> <table align="center" width="20%" border="1" cellpadding="2" cellspacing="3"> <tr> <th>Make Capacity</th> <th>surya</th> <th>Myscore</th> </tr> <tr> <td>40 W</td> <td>10:00</td> <td>10:50</td> </tr> <tr> <td>60 W</td> <td>11:00</td> <td>11:25</td> </tr> <tr> <td>100</td> <td>12:00</td> <td>1

Write HTML code to create following output by using ordered list . India, Maharastra, Madhyapradesh,panjab.

Image
Write   HTML code to create following output by using ordered list . India, Maharastra, Madhyapradesh,panjab.   <!DOCTYPE html> <html> <head> <title>Ordered list</title> </head> <body> <h1>Ordered List</h1> <ol type="a"> <li>India </li> <li> Maharastra</li> <li>Madhyapradesh</li> <li>Panjab</li> </ol> </body> </html>

Write HTML code to create following output by using unordered list.

Image
Write HTML   code   to create following   output   by using   unordered list. Mharashtra         Madhypradesh       Uttarpradesh 1 Nagpur            1 Bhopal                 1 kanpur 2 Wardha           2 Indor                    2 Azamgad 3 Mumbai          3 Ujjain                   3 Haridwar   <!DOCTYPE html> <html> <head> <title>Unordered list</title> </head> <body> <h1><center> Unordered List</h1> <table align="center" cellspacing="4" cellpadding="5"> <tr> <td><b>   Maharashtra</b></td> <td><b>   Madhypradesh</b></td> <td><b>   Uttarpradesh</b></td> </tr> <tr> <td><ul type=disc> <li>Nagpur</li> <li>Wardha</li> <li>Mumbai</li> </ol> <td><ul type=square> <li>Bhopal</li> &