write the test cases on prime number with result?

Answers were Sorted based on User's Feedback



write the test cases on prime number with result? ..

Answer / babitha

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

write the test cases on prime number with result? ..

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

write the test cases on prime number with result? ..

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

write the test cases on prime number with result? ..

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

write the test cases on prime number with result? ..

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

write the test cases on prime number with result? ..

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

Post New Answer

More Manual Testing Interview Questions

Hi Friends.... anyone know who is giving coaching for CSTE exam in bangalore....pls inform me that would be helpful for me...Thankx in advance.

2 Answers  


if any bug is found & that problem is resolve & make sure this type of problem is not arrise is any project also 1 - corrective & preventive Action 2 - Risk Analysis 3 - Impact Analysis 4 - Root Cause Analysis

1 Answers   NIIT,


what is port testing?when it is going to be done?

5 Answers  


How does compatibility testing differ while testing in Internet explorer and testing in Firefox?

0 Answers  


1. Hai, if we are not having any SRS,BRS docs., how can we prepare the test cases & how can we test the application ? 2. In this, is it possible to make 100% bug free.

4 Answers  






Did anyone have any experince with stocking in equity can you please tell me how to approach the project.I am a learner.help me please.give me ur suggestions.

0 Answers   CTS, Oracle,


1.How to maintain the Bug status Report? 2.What is project based Company and product based company?

2 Answers   Mobius,


can any body explain what is Build intervel period.what are the main components in PDCS(projectdatacollectionsheet)

1 Answers  


How do you react when the developer says that defect you logged is not valid?

2 Answers   L&T, MTN,


What is Windows Test Technologies? Where i will get all information of it.

0 Answers  


What is the difference between coupling and cohesion?

0 Answers  


what is beta testing

5 Answers   STQC,


Categories