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
HOw we can apply web service checkpoint in QTP 9.5? I tried it out with net connection also. But not getting success.
Which in-built function is used to format the number in the vbscript language?
Why to use option explicit in vb script?
Hi Friends, I have an issue like the describe below: I'm using QTP and I'm testing on SharePoint. As you knoe, SharePoint has a customize function for user, so that, If I add an object Web Table at the first time, that object was recognized by "index" and "html tag", after that, if someone change the display of web part, the "Index" of my object was changed as well and QTP unable to select that Web Table. Can you guide me how to identify or anyway to keep that Web Table object as unique object? Thanks a lot.
What are the disadvantages of vbscript?
What are string functions in vbscript?
How will you release the memory acquired by an array variable in vbscript?
By default in vbscript the arguments passed to functions and subroutines are by reference or by value?
What is Procedure or Subroutine in VB Script?
What are events in the vbscript language?
What aspects of vbscript make it safe so that a web page using vbscript cannot destroy or corrupt information on a user's computer?
Which object is used to work with the database in the vbscript language and what statement is used to create this object?
How can you create an object in vbscript?
Set srchobj=Description.Create() srchobj("type").value="text" srchobj("name").value="q" srchobj("html tag").value="input" browser("micclass:=google").Page("micclass:=google").webedit (srchobj).Set "qtp" what's wrong in my code pls tell me ? the above code working fine and i got my result pass,now i am trying to run the program it shows general run time error why?pls help me i am in learning stage ?
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("<