Given an array,print the sum and count of the multiples of 3 in the array. Javascript Program

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);

Check Also

How to debugg our flutter application

Debugging a Flutter application involves a variety of techniques and tools to identify and fix …

Leave a Reply

Your email address will not be published. Required fields are marked *