-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharmstrong.html
More file actions
229 lines (171 loc) · 3.01 KB
/
armstrong.html
File metadata and controls
229 lines (171 loc) · 3.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<html>
<head>
<script>
window.oncontextmenu =function(){console.log("Right Click Disabled");
return false;
}
</script>
<SCRIPT type="text/javascript">
focusInput = function()
{
document.focus();
};
processKeyEvent = function(eventType, event)
{
if (window.event)
{
event = window.event;
}
if(event.keyCode == 44)
{
alert("Photos are copyright 2011 @vaibhav");
return(false);
}
}
processKeyUp = function(event)
{
processKeyEvent("onkeyup", event);
};
processKeyDown = function(event)
{
processKeyEvent("onkeydown", event);
};
document.onkeyup = processKeyUp;
document.onkeydown = processKeyDown;
</SCRIPT>
<style>
body, html {
height: auto;
margin: 0;
}
.bg {
/* The image used */
background-image: url("img_girl.jpg");
/* Full height */
height: auto;
width: auto;
/* Center and scale the image nicely */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
</style>
<title>Java Programs #armstrong</title>
<link rel="stylesheet"type="text/css" href="armstrong.css">
</head>
<body>
<div class="bg">
<div class="header">
<img src="image/insta.png">
</div>
<h1>??What is an Armstrong Number??</h1>
<div >
Armstrong number is a number that is equal to the sum of cubes of its digits. For example 0, 1, 153, 370, 371,etc..
</a>
</div>
<div >
example:- 153=(1)cube +(5)cube +(3)cube=1+125+27=153....
</a>
</div>
<div >
Thus,153 is an Armstrong Number.
</a>
</div>
<h2>##Program:-</a>
</h2>
<div >
import java.util.*;
</a>
</div>
<div >
class armstrong
{
</a>
</div>
<div >
static void main()
{
</a>
</div>
<div >
Scanner sc=new Scanner(System.in);
</a>
</div>
<div >
int n,i,k,s=0,n1;
</a>
</div>
<div >
System.out.println("ENTER A NUMBER:-");
</a>
</div>
<div >
n=sc.nextInt();
</a>
</div>
<div >
n1=n;
</a>
</div>
<div >
for (;n!=0;)
</a>
</div>
<div >
{
</a>
</div>
<div >
k=(n%10)*(n%10)*(n%10);
</a>
</div>
<div>
</a>
</div>
<div >
n=n/10;
</a>
</div>
<div >
s+=k;
</a>
</div>
<div >
}
</a>
</div>
<div >
if(s==n1)
</a>
</div>
<div >
System.out.println(n1+" is an armstrong no.");
</a>
</div>
<div >
else
</a>
</div>
<div >
System.out.println(n1+" is not an armstrong no.");
</a>
</div>
<div >
}
</a>
</div><div >
}
</a>
</div>
<div class="fpwd">
<a href="index.html">HOME</a>
</div>
<div>
<h2>#suggested# :-</h2>
*<a href="HCF.html">HCF or GCD</a>
</div>
<div>
*<a href="pronic.html">Pronic Number</a>
</div>
</body>
</html>