answersLogoWhite

0


Best Answer

<SCRIPT LANGUAGE="VBSCRIPT">

DIM i,n,j

n = 100

DOCUMENT.WRITE("Prime nos are")&space(1)&"1"&space(2)&"2"&space(2)

X=0

FOR j = 3 TO n

FOR i = 2 TO (j-1)

IF i MOD j <> 0 THEN

DOCUMENT.WRITE(i)&space(2)

X=1

END IF

NEXT

NEXT

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Vb script to find given number is prime or not?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How can find prime numbers using do while in java script?

//some students also asked it with alert dialog box ! I have done it in a HTML page 100% working best of Luck !_Z triplezero here :) &lt;script type="text/javascript"&gt; var inum, icount=2; var irem; inum = prompt("Enter a number."); if(inum==1) { alert("The no. is not prime"); document.write("The no. is not prime"); exit(0); } if(inum==2) { alert("The no. is prime"); document.write("The no. is prime"); exit(0); } do { irem=inum%icount; if(irem==0) { alert("The no. is not prime"); document.write("the given no is not prime"); exit(0); } icount++; } while(icount&lt;=(inum/2)); alert("The no. is prime"); document.write("the given number is prime"); &lt;/script&gt;


Find the number with the given prime factorization 7x11x13x17?

17,017


How do you find the primeFactors of a given number?

By dividing it by the prime factors that have no remainders


How do you find twin primes of number?

To find twin primes of a given number, iterate through the numbers starting from the given number, and for each number, check if both the number and the number+2 are prime. If they are, then they form a pair of twin primes with the given number.


Why is 836475 not a prime number?

A number which is divisible by itself and 1 is called prime number. A prime number has only two factors.But, 836475 is also divisible by5, i.e. 836475 has more than two factors.Therefore, the given number is not prime.In order to show that given number is not prime there is no need to find all the factors, we should show that given number has more than two factors.


To find weather the given no is prime or not?

Prime numbers have two and only two factors. If the number has more than two factors, it is not prime.


How do you find the given number is prime or not?

you see if it can be divided by any numbers that are not 1 or itself


How do you write a program to find whether the given number is prime or not and show output?

#include&lt;stdio.h&gt; #include&lt;conio.h&gt; void main() { int n,a=2; clrscr(); printf("\n enter n"); scanf("%d",&amp;n); if(i&lt;=a-1) { if(a%i==0) { printf("\n the given number is not a prime number"); break; } i++; if(a==i) { printf("\n the given number is a prime number"); } getch(); output: enter the value of n:2 the given number is prime number


How can divisibility rules help you find the prime factorization of a number?

they can help you by finding the two factors of the number given


Are there prime numbers over 100?

Sure, since there are INFINITELY MANY prime numbers, that means you will find prime numbers over any given number.


What is the Python script for nth prime number?

As people have been trying to find a script of some sort using the most powerful computers in the world for 60 years to no result, so no one can assist you in this question yet...


How do you find the greatest prime factor for a given number?

Start with the lowest prime factors 2, 3, 5, 7 etc and work up.