1 min to read
Hackerrank 10 Days of JavaScript Day 0: Hello, World, Data Types
Are you up for the 10 Days of JavaScript challenge on Hackerrank? This challenge is a collection of ten tasks that focus on JavaScript and, to some extent, HTML and CSS.
In this series, I will be sharing my solutions to the challenges. I will be sharing the solutions in JavaScript. I will also be sharing the solutions in HTML and CSS for the challenges that require it.
Problem Statement
-
Use
console.log()
to print Hello, World! on a new line in the console, which is also known as stdout or standard output. The code for this portion of the task is already provided in the editor. -
Use
console.log()
to print the contents ofparameterVariable
(i.e., the argument passed to main).
Test Case of Hello World HackerRank Solution
Day 0: Data Types
- The Input to the function is an integer, float, and string
- The Output of the function is the sum of the integer, float, and string
Explanation
i
,d
,s
are the three variables of different data types.i
is an integer,d
is a double, ands
is a string then we declared the three variablesi2
,d2
,s2
of different data types.i2
is an integer,d2
is a double, ands2
is a string and we take the input from the user and store it in the variablesi2
,d2
,s2
.- Then we add the integer and double and print the result and round the result to the 1 decimal place.
- Then we concatenate the string and print the result.