<h4>Enter Your marks out of 600</h4>
<input type="number" max="600" min="0" onInput="caliculatePercent(this.value)">
// Scales with continuous input and continuous output
const heighestMarks = 600
let scale = d3.scaleLinear()
              // Provide the range of values  
              // Provide range of output need

function caliculatePercent(value){ 
    .text(`Your Percentage is ${scale(value)}%`)

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.