-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjava_primeNumber.html
More file actions
84 lines (73 loc) · 2.01 KB
/
Copy pathjava_primeNumber.html
File metadata and controls
84 lines (73 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="../img/CodeHelper.png">
<link rel="stylesheet" href="../css/style.css">
<link href="https://fonts.googleapis.com/css?family=Montserrat|Oswald|Roboto+Condensed" rel="stylesheet">
<title>CodeHelper | Helping students to learn Code.</title>
</head>
<body>
<header>
<nav>
<h1>CodeHelper</h1>
<ul>
<li><a class="homewhite" href="../main.html">Home</a></li>
<li><a class="sameclass" href="../contact_us.html">Contact Us</a>
<li><a class="sameclass" href="../about_us.html">About Us</a>
<li><a class="sameclass" href="#">Our Team</a>
<li><a class="sameclass" href="../login.html">Login</a></li>
<li><a class="sameclass" href="../signup.html">Sign Up</a></li>
</ul>
</nav>
</header>
<div class="main">
<div class="ptext">
<h1>Welcome to Code Helper </h1>
</div>
</div>
<div class="topmenu">
<nav>
<ul>
<li><a class="menucolor" target="_blank" href="../c.html">C</a></li>
<li><a class="menucolor" target="_blank" href="../c++.html">C++</a>
<li><a class="menucolor" target="_blank" href="../python.html">Python</a>
<li><a class="menucolor" target="_blank" href="../java.html">Java</a>
</ul>
</nav>
</div>
<div class="c-bs">
<h1> Prime Number</h1><br>
<p>
To Check weather the number is Prime or Not.
</p><br>
<h2 class="source-code">➣ Source Code</h2>
<p>
<pre>
<xmp>
class PrimeExample{
public static void main(String args[]){
int i,m=0,flag=0;
int n=17;//it is the number to be checked
m=n/2;
for(i=2;i<=m;i++){
if(n%i==0){
System.out.println("Number is not prime");
flag=1;
break;
}
}
if(flag==0)
System.out.println("Number is prime");
}
}
</xmp>
</pre>
</p>
<h2 class="source-code"> ➣ Output</h1>
<pre style="font-size: 20px;">
Number is prime
</pre>
</div>
<div class="back"> <a href="../c.html"> BACK </a> </div>
<div class="footermain">Made with ❤</div>