Implement A Program To Generate The Result of Arithmetic Expression (Windows Applications)
Implement A Program To Generate The Result of Arithmetic Expression (Windows Applications)
Implement A Program To Generate The Result of Arithmetic Expression (Windows Applications)
End Sub
End Sub
c=a+b
End Sub
Output
2. Write a program using inputbox(),msgbox() and display the result of arithmatic operation
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim i As Integer
Dim j As Integer
Dim r As Integer
i = InputBox("Enter first number")
j = InputBox("Enter second number")
r = Val(i) + Val(j)
MsgBox("Addition is =" & r)
End Sub
Dim i As Integer
Dim j As Integer
Dim r As Integer
i = InputBox("Enter first number")
j = InputBox("Enter second number")
r = Val(i) - Val(j)
MsgBox("Subtraction is =" & r)
End Sub
Dim i As Integer
Dim j As Integer
Dim r As Integer
i = InputBox("Enter first number")
j = InputBox("Enter second number")
r = Val(i) * Val(j)
MsgBox("Multiplication is =" & r)
End Sub
Dim i As Integer
Dim j As Integer
Dim r As Integer
i = InputBox("Enter first number")
j = InputBox("Enter second number")
r = Val(i) / Val(j)
MsgBox("Division is =" & r)
End Sub
End Class
3. Write a program using while to print prime number between 1 to 100 using flag
Imports System
Imports System.Diagnostics.Metrics
Imports System.Runtime.Serialization
Imports System.Security.Authentication.ExtendedProtection
Imports System.Threading
Module Program
Sub main()
Dim flag As Boolean
End If
Next
Console.WriteLine("The Count IS " & count)
Console.ReadLine()
End Sub
End Module
Output
4. implement a program to find greatest of three numbers
Imports System
Module Program
Sub Main(args As String())
Dim a, b, c As Integer
Console.WriteLine("Enter value of a: ")
a = Console.ReadLine()
If (a > b) Then
If (a > c) Then
Console.WriteLine("Greater number a ")
Else
Console.WriteLine("Greater number c ")
End If
Else
If (b > c) Then
Console.WriteLine("Greater number b ")
Else
Console.WriteLine("Greater number c ")
End If
End If
Console.ReadLine()
End Sub
End Module
Output
5. Develop a program for performing arithmetic operation using select case
Imports System
Module Program
Sub Main(args As String())
Dim a, b, ch, c As Integer
Console.WriteLine("Enter value of a: ")
a = Console.ReadLine()
Console.WriteLine("1.Addition ")
Console.WriteLine("2.Subtraction ")
Console.WriteLine("3.Multiplication ")
Console.WriteLine("4.Division ")
Console.WriteLine("Enter what you want to perform ")
ch = Console.ReadLine()
Select Case ch
Case 1
c=a+b
Console.WriteLine("Addition is " & c)
Case 2
c=a-b
Console.WriteLine("Subtraction is " & c)
Case 3
c=a*b
Console.WriteLine("Multiplition is " & c)
Case 4
c=a/b
Console.WriteLine("Division is " & c)
Case Else
Console.WriteLine("Wrong input")
End Select
End Sub
End Module
Output
6. write a program using SELECT CASE STATEMENT to count the vowel from A to Z alphabets
(Windows application )
For i = 0 To TextBox1.Text.Length - 1
End Select
Next
End Sub
End Class
Output
7. Write a program using while statement to print 1 to 100 EVEN ODD number (Windows
Application)
End Sub
End Class
Output
8. Write a program to display armstrong numbers from 1 to 2000
10.Write a program to generate a button at runtime
Me.Controls.Add(b)
End Sub
End Class
Output
Output
12. Write a program to generate panel control at run time(Windows application)
Public Class Form1
End Sub
End If
ErrorProvider1.SetError(TextBox2, " Please Enter valid password")
ErrorProvider1.SetError(TextBox1, "Please Enter your name")
End Sub
End Sub
End Class
Output
15.Implement a program to find the factorial of a number using recursion (simply use parameterised
function)(windows application)
End If
End Function
End Sub
End Class
16. write a program to identify the volume of box with three data members length,breadth,height
Imports System
Module Program
End Sub
End Class
Sub main()
Dim v As New Volume_of_box()
Dim a, b, c As Double
Console.WriteLine("Enter lenghth,breadth and height :-- ")
a = Console.ReadLine()
b = Console.ReadLine()
c = Console.ReadLine()
v.acceptdata(a, b, c)
v.calculate()
Console.ReadKey()
End Sub
End Module
Output
Module Program
End Sub
Sub calculate()
Dim area As Double
area = 3.14 * rad * rad
Console.WriteLine("The radius of circle rad ={0} & and Area is {1} ", {rad, area})
Console.WriteLine(area)
End Sub
End Class
Sub main()
Dim radius As Double
Console.WriteLine("Enter radius of Circle :-- ")
radius = Console.ReadLine()
Dim v As New Circle(radius)
v.calculate()
Console.ReadKey()
End Sub
End Module
Output
18. Write any program of exception handling of your choice
a = Val(TextBox1.Text)
b = Val(TextBox2.Text)
Try
div = a / b
Label4.Text = "Division is" & div
Catch ex As Exception
Label4.Text = "Exception Division by number zero"
End Try
End Sub
End Class
Output
19. Write a program to display the TRAFFIC SIGNAL using timer control
Public Class Form1
If PictureBox1.Visible Then
PictureBox1.Visible = False
PictureBox2.Visible = False
PictureBox3.Visible = True
End If
End Sub
End Sub
End Sub
End Class
Output
20. Implement a program using the combobox and listbox by selecting semester and display subjects
Public Class Form1
If ComboBox1.SelectedIndex = 0 Then
ListBox1.Items.Clear()
ListBox1.Items.Add("English")
ListBox1.Items.Add("BMS")
ListBox1.Items.Add("Chemistry")
End If
If ComboBox1.SelectedIndex = 1 Then
ListBox1.Items.Clear()
ListBox1.Items.Add("M2")
ListBox1.Items.Add("C programming")
ListBox1.Items.Add("EEC")
End If
If ComboBox1.SelectedIndex = 2 Then
ListBox1.Items.Clear()
ListBox1.Items.Add("DBMS")
ListBox1.Items.Add("C++")
ListBox1.Items.Add("CGR")
End If
If ComboBox1.SelectedIndex = 3 Then
ListBox1.Items.Clear()
ListBox1.Items.Add("DCC")
ListBox1.Items.Add("GAD")
ListBox1.Items.Add("SEN")
End If
If ComboBox1.SelectedIndex = 4 Then
ListBox1.Items.Clear()
ListBox1.Items.Add("AJP")
ListBox1.Items.Add("ACN")
ListBox1.Items.Add("PHP")
End If
End Sub
End Class
Output