write the test cases on prime number with result?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Hi, This is vkram.I had completed my B.E in May 2005 & currently i am undergoing Testing Course. I want to join as a Fresher in any MNC. What should I tell why u r coming to testing field & what u did this 2 years?

1768


I studied MBA, I want learn any softwarecourse, which course is better hadoop or testing tools(manual+selenium?)

1422


need answer interviewer will ask me about all project which i mention in resume or presently i'm working??please reply tomorrow is my interview

1849


tell wat u did in ur banking project?

2058


I have 2+ year of work exp in manual testing and i have good knowledge in QTP.anybody have requirement in your company please please tell me

1689


what are the responsibilities for QA tester to test application on UNIX environment??? what skills required for unix???

1809


we are about to implement a Test tool to test the performance of website, so what script does a tester should know (friends plz help me)

1761


How would u test and automate an Antivirus application ?

1765


What are the benefits of creating multiple actions within any virtual user script?

1949


What is the difference between a standalone application, client-server application and web application?

984


When we are recording in WinRunner and interact with the AUT, what does WinRunner do?

1791


give me a example of writing a test case,take any good example which i can understand easily.

1911


what is the technical challange you faced in your module.please ans me the question i just want example can me any example please very important

1691


How we will test ubercate

1785


Can any one suggest how to write the bug reports effectively by optimizing what we want to describe?

1762