-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjava_armstrongNo.html
More file actions
85 lines (74 loc) · 2.11 KB
/
Copy pathjava_armstrongNo.html
File metadata and controls
85 lines (74 loc) · 2.11 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
85
<!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> Armstrong Number</h1><br>
<p>
Armstrong number is a number that is equal to the sum of cubes of its digits for example 0, 1, 153, 370, 371, 407 etc.
</p><br>
<h2 class="source-code">➣ Source Code</h2>
<p>
<pre>
<xmp>
class ArmstrongExample{
public static void main(String[] args) {
int c=0,a,temp;
int n=153;//It is the number to check armstrong
temp=n;
while(n>0)
{
a=n%10;
n=n/10;
c=c+(a*a*a);
}
if(temp==c)
System.out.println("Armstrong number");
else
System.out.println("Not armstrong number");
}
}
</xmp>
</pre>
</p>
<h2 class="source-code"> ➣ Output</h1>
<pre style="font-size: 20px;">
Armstrong number
</pre>
</div>
<div class="back"> <a href="../c.html"> BACK </a> </div>
<div class="footermain">Made with ❤</div>