Posts

Showing posts from May, 2016

Vb.net Some programmes

Q 1 --write a programme to find  the given no. is even or odd? Q 2-- -write a programme to find  factorial the given no.? Q 3 -- write a programme to find  the given no.  is prime or not? Q 4--  creating a connection & show data on data grid view. Q 5-- write a programme to print 1 to 10 no in a list box . Q1 Ans. Private Sub Button1_Click ( ByVal sender As System. Object , ByVal e As System. EventArgs ) Handles Button1. Click Dim Mynumber As Integer Dim isEven As Boolean Mynumber = Val ( TextBox1. Text ) If Mynumber Mod 2 = 0 Then isEven = True MsgBox ( "The number " & " " & Mynumber & " is an even number" ) Else MsgBox ( Mynumber & " " & "is an Odd number" ) End If End Sub End Class Public Class Form1  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click  Dim i, x