About 943,000 results
Open links in new tab
  1. Write a VB Script to check whether a given number is prime or …

    Apr 2, 2010 · We can use a For Next Loop or Do While Loop to check whether a number given is a prime number or not in VB Script. The challenge lies in writing a VB script without using any built in functions of VB Script.

  2. Determine Prime Numbers using SINGLE do-while Loop

    printf("Enter max number: "); scanf("%i", &max); /*prints prime numbers while the max value. is greater than the number being checked*/ do { x = 0; //using x as a flag. for (int i = 2; i <= (n / 2); i++) { if ((n % i) == 0) { x = 1; break; if (x == 0) //if n is prime, print it! printf("%i\n", n); n++; //increase number to check for prime-ness.

  3. Visual Basic: How can i display the prime numbers between 1 and …

    This is my fastest VBA code to generate prime numbers between two numbers. The generated prime numbers are put in clipboard. You will need to open your ms office word and type Ctrl+V to view all the generated prime numbers. c = Round(Sqr(a)) + 1. For b = 2 To c. If a = 1 Or (a Mod b = 0 And c <> b) Then. Exit For. Else. If b = c Then.

  4. Quickest way to determine if a number is a prime number or …

    Mar 19, 2019 · For checking a single number I use a faster variant of your Code2 with a little extra checking. Here is the pseudocode: boolean function isPrime(num) //1, 0 and negatives cannot be prime.

  5. Do...While Loop Prime Numbers Tutorial Visual Basic - YouTube

    Learn how to use a Do... While Loop using Visual Basic. Also demonstrates a prime number algorithm.

  6. VBScript Code - Finding whether a number is Prime or not

    Nov 19, 2010 · VBScript Code - Finding whether a number is Prime or not sub isprime(a) flag=1 i=2 While i < a/2 And flag if (a Mod i = 0) then flag = 0 end if i=i+1 wend If flag =1 then msgbox a & " is Prime" else msgbox a & " is NOT Prime" End if End sub isprime(15)

  7. Could Anybody tell me VBScript for Check if a given number is Prime

    Check if a given number is Prime number-Don't use any Built-in Functions Boolean/int is Prime(int number).. Thanks in advance.

  8. Write a VB program to find the prime numbers between 1 to100

    Dec 31, 2017 · This is an example of a VB program to print the prime numbers between 1 to 100. Private Sub cmdPrime_Click() Dim p, n, i As Integer p = 1 Print “Prime Numbers are : “ For n = 1 To 100 For i = 2 To n – 1 If n Mod i = 0 Then p = 0 Exit For Else p = 1 End If Next If p = 1 Then Print n End If Next End Sub

  9. Vb script program to find out given number is prime numbers or

    Vb script program to find out given number is prime numbers or not? Note: write the above code in notepad and save it as Isprime.vbs, then click on the file to enter a number, It will display whether the given number is prime or not.

  10. VBScript Loops: Do While, Do Until, While, For Each (Example)

    Dec 30, 2024 · VBScript Do While Loop. If you do not know the number of times you need to execute a block of code, then you will be using Do While loops. For example, you want to output the message “Welcome” while the value of the variable x is less than 5. In such case, Do While loop will be used.

Refresh