title: how to check number in percentage and print it in an array or object, if number is exits then it should return 1 otherwise 0
body: <p>in a array of [5,10,15,20,40]. we need to check the number with % and if we get 5 and 10 then we will take it in 10% and print it 1 so for 10 to 20 we consider as 20% and check the number if we get any number from there then we will increase the number like wise we need to calculate.
  for example [ 10, 4, 40, 50, 70] the max number is 100 so that's the 100th% and the result should be [1, 1, 0, 1, 1, 0, 1, 0, 0, 0] there is 1 element in 0-10% (4), 1 in 10-20% (10), none in 20-30%, and so forth. –</p>
  <pre><code>function calculating_marks(x) {
    for (let i = 0; i &lt; x.length; i++) {
      x[i] &lt;= 10 ? console.log(&quot;1&quot;) : console.log(&quot;0&quot;)
      x[i] &gt; 10 &amp;&amp; x[i] &lt;= 20 ? console.log(&quot;1&quot;) : console.log(&quot;0&quot;)
      x[i] &gt; 20 &amp;&amp; x[i] &lt;= 30 ? console.log(&quot;1&quot;) : console.log(&quot;0&quot;)
      x[i] &gt; 30 &amp;&amp; x[i] &lt;= 40 ? console.log(&quot;1&quot;) : console.log(&quot;0&quot;)
      x[i] &gt; 40 &amp;&amp; x[i] &lt;= 50 ? console.log(&quot;1&quot;) : console.log(&quot;0&quot;)
      x[i] &gt; 50 &amp;&amp; x[i] &lt;= 60 ? console.log(&quot;1&quot;) : console.log(&quot;0&quot;)
    }
  }
  
  marks = [5,10,20,30,35,50]
  calculating_marks(marks)
  </code></pre>