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 / sumit
//An Extremely Efficient method.
void chkprime(int n)
{
int i=2,j=1;
for(;i<=n/i;j++,i++)
{
if (n%i == 0)
{
break;
}
}
if ( n%i != 0 )
printf("%d is prime. Comparisons: %d\n",n,j);
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
write a function to read the items from combobox of Flight reservation & save in excel (QTP)??
write a program to display configuration of a local system with the help of vb script.
What are the 2 ways to pass a value to the function?
Mention what is the difference between vbscript and vba?
i wrote vbscripit code in notepad i got error i am in learning stage if u ps tell me what wrong in my code my error is "object required descriptive at line one run time error"and my code is "set usernameobj=Descriptive.Create() usernameobj( "name").value="Username" set passwordobj=Descriptive.Create() passwordobj("name").value="password" set signinobj=Descriptive.Create() signinobj("name").value="sigin" browser("gmail").page("gmail").WebEdit("usernameobj").set ("enter username") Browser("gmail").Page("gmail").WebEdit("passwordobj").Set secure.Crypt.Encrypt("enter password") browser("gmail").page("gmail").WebButton("siginobj").click
i need to sort the data using qtp script for this how i need to write a qtp script
In html file what is an ideal position to include vbscript?
What is the use of the ‘open’ method to work with the database in the vbscript language and what connection string is passed in the same and what is its usage?
How to create a function in vbscript?
Mention what is variant in vbscript?
How will you get a combined string from array of string in vbscript?
How to identify column in VSFlexgrid? My VSFlexgrid window is identified as 'Active X Control'
Can anyone send me a vb script function for verifying the functionality of active links on a web page
Explain about scrrun.dll?
1. How to handle object implementation change in DP for Ex: i have login page with username,pasword (editboxes),login,cancel(buttons). Here i written DP code for login page with the help properties. My questions: 1.If properites are changing dynamically i will do (i want code for that) 2.if objects are changed dynamcally i will do (i wnat code for that)