Computer Science, asked by javidahmadj4641, 4 months ago

write a program in visual basics to check whether a number is prime or not​

Answers

Answered by Anonymous
1

Answer:

Private Sub btnCheckIt_Click()

isprime = "The Number is Prime"

notprime = "The Number is not Prime"

primeness = True

For x = 2 To Sqr(N)

If N / x = Int(N / x) Then primeness = False: Exit For

Next

Status = IIf(primeness, isprime, notprime)

End Sub

Answered by Anonymous
2

Explanation:

Private Sub btnCheckIt_Click()

Private Sub btnCheckIt_Click()isprime = "The Number is Prime"

Private Sub btnCheckIt_Click()isprime = "The Number is Prime"notprime = "The Number is not Prime"

Private Sub btnCheckIt_Click()isprime = "The Number is Prime"notprime = "The Number is not Prime"primeness = True.

Private Sub btnCheckIt_Click()isprime = "The Number is Prime"notprime = "The Number is not Prime"primeness = True.For x = 2 To Sqr(N)

Private Sub btnCheckIt_Click()isprime = "The Number is Prime"notprime = "The Number is not Prime"primeness = True.For x = 2 To Sqr(N)If N / x = Int(N / x) Then primeness = False: Exit For.

Private Sub btnCheckIt_Click()isprime = "The Number is Prime"notprime = "The Number is not Prime"primeness = True.For x = 2 To Sqr(N)If N / x = Int(N / x) Then primeness = False: Exit For.Next.

Private Sub btnCheckIt_Click()isprime = "The Number is Prime"notprime = "The Number is not Prime"primeness = True.For x = 2 To Sqr(N)If N / x = Int(N / x) Then primeness = False: Exit For.Next.Status = IIf(primeness, isprime, notprime)

Similar questions