Generation

generate functionTue, 11 Jul 2023

calculadora

function add(a, b) { return a + b; } function sub(a, b) { return a - b; } function mul(a, b) { return a * b; } function div(a, b) { return a / b; } function calculadora(a, b, c) { if (c === '+') { return add(a, b); } else if (c === '-') { return sub(a, b); } else if (c === '*') { return mul(a, b); } else if (c === '/') { return div(a, b); } } calculadora(10, 5, '+')

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant