We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
var i = 4; // Integer
var d = 4.0; // Double
var s = "HackerRank "; // String
// Read input values
let num = parseInt(readLine()); // Read integer from input
let myDouble = parseFloat(readLine()); // Read double from input
let myString = readLine(); // Read string from input
// Print the sum of both integer variables
let sum = num + i;
console.log(sum);
// Print the sum of both double variables, rounded to 1 decimal place
let sum1 = myDouble + d;
console.log(sum1.toFixed(1)); // Print with one decimal place
// Concatenate and print the String variables
let newString = s + myString;
console.log(newString);
}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 1: Data Types
You are viewing a single comment's thread. Return to all comments →
Javascript solution for those whoo need help
{ // Predefined variables
}