-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
36 lines (25 loc) · 742 Bytes
/
Copy pathapp.js
File metadata and controls
36 lines (25 loc) · 742 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
// decimal ko hata ke number aajae
// Math.round krna (4.6 => 5) (4.4 => 4)
// Math.floor krna decimal gaeb krdo or number rehne do (4.6 => 4) (4.9 => 4)
// Math.ceil krna , halka sa bhe decimal ho aik number barhado , (4.001 ==> 5)
// var number = 4.5
// // Math.round
// console.log(Math.round(number))
// // Math Ceil
// console.log(Math.ceil(number))
// // Math Floor
// console.log(Math.floor(number))
var h2 = document.getElementById('random')
function generateRandomNumber() {
var num =Math.ceil(Math.random()*6)
// var round = Math.round(num)
h2.innerText = num
}
var num = Math.ceil(Math.random()*6)
console.log('num',num);
function matchNumber(val){
console.log(val);
if(val == num ){
alert("correct")
}
}