0
What wrong with this code. I am not able to understand
function main() { var amount = parseFloat(readLine(), 10); var rate = parseFloat(readLine(), 10); function convert(amount, rate); var convert =amount*rate; return convert; convert(amount,rate) console.log(convert(amount,rate) }
10 Réponses
+ 2
+ 1
Vansh Gupta
because you are missing curly braces {} for the function
+ 1
Vansh Gupta solved
0
I would call the variable convert with a other name for example:
let resultConvert = amount*rate;
0
I Am Groot !
Please solve this
So I can get help
0
Krish
This is Mwe
Please solve
0
function main() {
var amount = parseFloat(readLine(), 10);
var rate = parseFloat(readLine(), 10);
console.log(convert(amount, rate));
}
function convert(a,b){
return a*b;
}
- 1
Vansh Gupta
It's simple.
convert is a function which has 2 parameters amount and rate and that function returns the multiplication of the parameters.