Commit 4a73d379 by Yovan Martinez

terminado el ejercitario 01 de javascript

parents
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="ecuacioncuadratica.js"></script>
<title>documento</title>
</head>
<body>
<img src="" alt="">
<p id="elelegido">
</p>
<p id="acapone">
</p>
<div id="imagen">
</div>
</body>
</html>
\ No newline at end of file
//Ejercicio nro 1
function ecuacion(a, b, c) {
return (-b + Math.sqrt(Math.pow(b, 2) - 4 * a * c)) / (2 * a);
}
console.log(ecuacion(4, -64, 2));
//Ejercicio nro 2
function ecuacion(a, b, c) {
return (-b - (Math.sqrt(Math.pow(b, 2) - 4 * a * c))) / (2 * a);
}
ecuacion(4, -64, 2);
//Ejercicio nro 3
function cosararahtml(id, string) {
document.getElementById(id).innerHTML = string;
}
cosararahtml("elelegido", "hola soy un texto muy util la verdad");
//Ejercicio nro 4
function numeroaleatorio(id) {
let value = Math.floor(Math.random() * (100 - 0) + 0);
document.getElementById(id).innerHTML = value;
}
numeroaleatorio("acapone");
//Ejercicio nro 5
function numeroaleatorio(id) {
let value = Math.floor(Math.random() * (100 - 0) + 0);
document.getElementById(id).innerHTML = value;
}
numeroaleatorio("imagen");
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment