Hi, Anybody could you Please tell me How to write the
script for Checking whether given number is Prime Number or
not..Thanks in Advance
Answer Posted / anant
boolean isPrime(int num){
if(num==0 || num==1){
System.out.println("Number should be greater than 1");
System.Exit(0);
}
if(num%2==0 || num%3==0 || num%5==0 || num%7==0)
System.out.println("Number is not prime");
else
System.out.println("Number is prime");
}
Is This Answer Correct ? | 2 Yes | 14 No |
Post New Answer View All Answers
Which loop is used in case of arrays in the vbscript language?
What are class properties?
after medical test,when will be the police verification
Explain the adodb.stream class?
what is the use of QCUtil? explain with one example?
Write a vbscript procedure that converts feet to inches. Hint: there are 12 inches in a foot?
If we take 2 strings as “good” and “bad” then what will ‘+’ and ‘&’ operators return?
What is the purpose of the err object in the vbscript language?
Explain the constants in vbscript?
How to declare an array in vbscript?
How many types of operators are available in the vbscript language?
write any ttest cases using check points and parameterization
How will you release the memory acquired by an array variable in vbscript?
Which operator can be used to do an xor operation in vbscript?
How will you get the smallest subscript of an array in vbscript?