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
Can u describe what kind of testing are for OTC derivates by banks.
Mention what is vbscript procedures?
Explain How do you create a recordset object in vbscript?
Why is it recommended to close the database connection every time after the work is completed?
How will you check that a variable is an array in vbscript?
What are the properties of regexp object?
What are the different types of loops available in the vbscript language?
How to declare an array in vbscript?
How to open a file. What is the perpose of true and false mode there?
How to Import data from a file (file is on the desktop) to the data table
What is the difference between do until loop and do while loop?
if u ve resrevation for train and u get a number supose 1234xxxokie.after sucessul entering all required fields. now u put that number in search and want to chk wether these ar same or not if both ar same then its okie otherwise test fail.what would be the vb script code for it to compare these two values of different page.
What are the data types supported by vbscript?
How to make sure that items in a wintree are sorted al?
I need to get some data from data base and store this
(retrieved) data in a excel sheet using VB script in QTP9.0
I have created connection for data base
I have created as excels sheet by using
Set XL=CreateObject("Excel.Application")
XLworksheet.cells(1,1).value= rs.fields.item("<