Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Module VBModule
Sub Main()
Dim i As Integer
Dim a As Integer
Dim check As Integer
Console.WriteLine("Enter Number")
a = Console.ReadLine()
for i=2 To a-1
If a Mod i=0
check=1
else
check = 0
End If
Next i
If check=1
Console.WriteLine("Not A Prime Number")
Else
Console.WriteLine("Prime Number")
End If
End Sub
End Module
Module VBModule
Sub Main()
Dim intX As Integer 'переменная для ввода данных
Dim intR As Integer 'переменная для вывода результата
Console.Write("введите целое трехзначное число");
Console.Write("Enter a natural number: ")
strNumber = Console.ReadLine()
intX = CInt(strNumber)
rem intR = (intX Mod 10) + (intX \ 10) Mod 10 + (intX \ 100) Mod 10
rem Console.Write( "Сумма цифр числа " & intX & " равна " & intR);
End Sub
End Module
Private Sub txtNumeric_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtNumeric.KeyPress
If (DataGridView1.CurrentCell.ColumnIndex > 0) Then
If (Not Char.IsControl(e.KeyChar) And Not Char.IsDigit(e.KeyChar) And Not e.KeyChar = ".") Then
e.Handled = True
Else
'only allow one decimal point
If (e.KeyChar = "." And txtNumeric.Text.Contains(".")) Then
e.Handled = True
End If
End If
End If
End Sub