I am trying to make a program that if the user inputs a prime number then the program can help make it a divisible number by increasing it by 1 and if it becomes divisible then the label 1.Text will show that number. But i cant seem to find an answer
VB.Net Code:
Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim Ans As Integer = CInt(txtPrime.Text) Dim newAns As integer For b = 2 To Ans If Ans Mod b = 0 Then Label1.Text = Ans End If If Ans Mod b > 0 Then Exit For newAns = Ans + 1 Label1.Text = newAns Next b