const number=[3,4,5,12];
let sum=0;
let count=0;
for(let i=0;i<number.length;i++)
{
if(number[i]%3==0)
{
sum=sum+number[i];
count++;
}
}
console.log('3Sum='+sum+',3Count='+count);
const number=[3,4,5,12];
let sum=0;
let count=0;
for(let i=0;i<number.length;i++)
{
if(number[i]%3==0)
{
sum=sum+number[i];
count++;
}
}
console.log('3Sum='+sum+',3Count='+count);
This website uses cookies.