write the test cases on prime number with result?
Answers were Sorted based on User's Feedback
Precondition:let the prime no be n
case1: expected o/p (prime no)result
divide the no n by 1 remainder=0 pass
divide the no n by n remainder=0 pass
divide the no n by 2 remainder!=0 pass
.
.
divide the no n by upto n-1 and if remanider not equal zero
then it is a prime no.
| Is This Answer Correct ? | 43 Yes | 15 No |
Answer / guest
Testcase ID test condition Result
1 1 true
2 3 true
3 4 false
4 5 true
| Is This Answer Correct ? | 24 Yes | 15 No |
Answer / guest
-field area should take only numeric value
-number should not contain fraction or decimal
-number should not contain any special character
-number should be divisible by 1
-if number is divisible by other than 1 then reminder should
be 1
| Is This Answer Correct ? | 6 Yes | 3 No |
Answer / pavithramadhesh
import java.util.Scanner;
public class prime {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println("Enter a Number: ");
int a=sc.nextInt();
if(((a/a)==1) && ((a/1)==a)){
System.out.println(a+" is Prime Number");
}else {
System.out.println(a+" is Not Prime Number");
}
}
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / md.mosaj gohar
- chech if the number is not a decimal no.
- check if the number is not of the from p/q
- check if the number is not a negative no.
- if the number is a natural number a greater than 6 then,
-if it can be converted to the form 6k-1or
6k+1,then it is prime no.else not.
- for natural nos. less than 6: 2,3 7 5 are prime nos. to
be taken as granted.
| Is This Answer Correct ? | 4 Yes | 3 No |
Answer / surya gandepalli
for input = 1 , Ouput: should be "Not a Prime Number"
Prime Number(Definition): A number Greater Than 1 is called
a prime number, if it has exactly two factors, namely 1 and
the number itself.
so check with the boundary values.
({INPUT},OUTPUT ) = ({0,1,4}, {NOT PRIME})
({INPUT},OUTPUT ) = ({2,3,5}, {is PRIME})
{Destructive INPUT}=(Type Special Characters),(Copy Past
Special Characters from a Note Pad document Using Mouse ))
0 (Zero is the only Whole Number which is not a natural number)
1
| Is This Answer Correct ? | 2 Yes | 10 No |
Please Provide me the link to download Testing Category questions and answers If some body has downloaded it pleae send it to me Pavan : Email pavan_cd@yahoo.com Quetion2 : Can any body Explain me about Testing thumb rules
How do you test if an XML file is correct or not?
How to Trace a Defect?
From whom do u gather the use case document?
Hi Could someone please provide Siebel Testing Interview questions for 5 years exp.
What is Tracibility matrix?How we can use in real time application?
What is deferred status in defect life cycle?
hello there, can anyone tell me what type of question does lg soft company ask in written test especially for a quant part? Thanku
What is baseline?
What is online testing?
What is GUI Check list?
2 Answers Covansys, IDS Software,
1. WHAT IS USE CASE? WRITE AN EXAMPLE OF USE CASE? 2. WHAT ARE THE PROPERTIES OF DEFECT TEMPLATE? 3. WHAT ARE THE TYPES OF TESTING? 4. WHAT IS TESTING? 5. WRITE TEST CASES FOR YAHOO MESSENGER LOGIN? 6. EXPLAIN PROBLEMS IN COMMUNICATIONS WITH CLIENT? 7. WHAT IS WEB TESTING? 8. WHAT SHOULD A SUCCESSFUL TEST ENGINEER DO? 9. WHAT IS BI DIRECTIONAL TRACEABILITY MATRIX? 10. TELL ME A REAL ACENARIO WHICH YOU EVER FACED? 11. GREAT BUG YOU FOUND IN YOUR CAREER?