0% found this document useful (0 votes)
5 views6 pages

VB.NET Programming Examples and Outputs

The document contains practical VB.NET programs aimed at demonstrating various programming concepts. It includes examples for finding the maximum of three numbers, checking if a number is positive, negative, or zero, determining leap years, checking if a character is an alphabet, and finding the roots of a quadratic equation. Each program includes code snippets and specifies that the output will be displayed in a MessageBox.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views6 pages

VB.NET Programming Examples and Outputs

The document contains practical VB.NET programs aimed at demonstrating various programming concepts. It includes examples for finding the maximum of three numbers, checking if a number is positive, negative, or zero, determining leap years, checking if a character is an alphabet, and finding the roots of a quadratic equation. Each program includes code snippets and specifies that the output will be displayed in a MessageBox.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

VB.

NET PRACTICAL FILE


Name: ____________

Class: ____________

Subject: [Link]
Program 1: Maximum between three numbers
Aim:

To write a [Link] program for Maximum between three numbers.

Code:

Dim a As Integer = 10
Dim b As Integer = 20
Dim c As Integer = 15
If a > b And a > c Then
[Link](a)
ElseIf b > c Then
[Link](b)
Else
[Link](c)
End If

Output:

Output will be displayed in MessageBox.


Program 2: Positive, Negative or Zero
Aim:

To write a [Link] program for Positive, Negative or Zero.

Code:

Dim n As Integer = -5
If n > 0 Then
[Link]("Positive")
ElseIf n < 0 Then
[Link]("Negative")
Else
[Link]("Zero")
End If

Output:

Output will be displayed in MessageBox.


Program 3: Leap Year Check
Aim:

To write a [Link] program for Leap Year Check.

Code:

Dim y As Integer = 2024


If y Mod 4 = 0 Then
[Link]("Leap Year")
Else
[Link]("Not Leap Year")
End If

Output:

Output will be displayed in MessageBox.


Program 4: Alphabet Check
Aim:

To write a [Link] program for Alphabet Check.

Code:

Dim ch As Char = "A"


If [Link](ch) Then
[Link]("Alphabet")
Else
[Link]("Not Alphabet")
End If

Output:

Output will be displayed in MessageBox.


Program 5: Quadratic Equation Roots
Aim:

To write a [Link] program for Quadratic Equation Roots.

Code:

Dim a As Double = 1, b As Double = -5, c As Double = 6


Dim d As Double = b*b - 4*a*c
If d >= 0 Then
[Link]("Roots are real")
Else
[Link]("Roots are imaginary")
End If

Output:

Output will be displayed in MessageBox.

You might also like