-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3.html
More file actions
44 lines (35 loc) · 1021 Bytes
/
3.html
File metadata and controls
44 lines (35 loc) · 1021 Bytes
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
<!DOCTYPE html>
<html>
<!--
JavaScript program to check if the last digit of the three given positive integers is the same.
-->
<head>
Exercise no : 3
</head>
<body>
<script>
'use strict';
function checkNumber(num1,num2,num3){
if( num1 == "" || num2 == "" || num3 == "" || isNaN(num1) || isNaN(num2) || isNaN(num3) ){
alert('plz enter anynumber');
}
else {
num1 = num1 % 10;
num2 = num2 % 10;
num3 = num3 % 10;
if(num1 == num2 && num2 == num3)
{
alert('numbers are same.')
}
else{
alert('numbers are not same');
}
}
}
let number1 = prompt('Enter first number: ');
let number2 = prompt('Entet second number: ');
let number3 = prompt('Enter third number');
checkNumber(number1,number2,number3);
</script>
</body>
</html>