1-topshiriq
const result =document.getElementsByClassName('result')
let a=prompt('A ni kiriting')
let b=prompt('B ni kiriting')
let c=prompt('C ni kiriting')
let solutions=quadratFunction(a,b,c)
function quadratFunction(a,b,c){
let disc=b*b-4*a*c
let solution=[]
if(disc>0){
let x1=(-b+Math.sqrt(disc))/(2*a)
let x2=(-b-Math.sqrt(disc))/(2*a)
solution.push(x1,x2)
}else if (disc===0){
let x=-b/(2*a)
solution.push(x)
}
else {
console.log('Qiymat mavjud emas')
}
return solution
}
var n = prompt("Masiv elementlari sonini kiriting:");
var A = [];
uchun (var i = 0; i < n; i++) {
A[i] = Float(prompt("A[ massiv elementini kiriting" + i + "]:"));
}
funktsiya geometrikMean(arr) {
var mahsulot = 1;
for (var i = 0; i < arr.length; i++) {
mahsulot *= arr[i];
}
var geometrikMean = Math.pow(mahsulot, 1 / arr.length);
return geometrikMean;
}
var natija = geometrikMean(A);