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
What are class properties?
Mention the rules for using option explicit statement?
Explain some uses of vb script?
how to increasing the numbers in a given text box please write a vb script
Can we create Crystal Report object in QTP?If yes then what it is and what are its various properties?
What are the advantages of vbscript?
why variable name should not exceed 255 characters?
Which keyword is used to declare a variable in the vbscript language?
How do you declare a variable in vbscript?
Which conditional statement is the most convenient one to use in the case of multiple conditions in the vbscript language?
How to replace junk code recorded by QTP with a mall function.
give me any information abou vb script books learn quckly
Which operator is used to perform the comparison among 2 operands in the vbscript language?
What are the different types of loops available in the vbscript language?
What are the differences between sub procedures and function procedures?