How to become a millionaire?

by Nenad Novakovic

JavaScript

var monthlyProfits = 0;
var investment = 100;
var output = '';

for (var i = 1; i <= 365; i++) {
  investment = investment + ((investment * 3) / 100);

  output += `<p>Day ${i} investment: <strong>${investment}</strong></p>`;

  monthlyProfits += investment;
}

document.body.innerHTML = output;