JavaScript Challenge-9
/*
Create a function that takes two arguments: the original price and the discount percentage as integers and returns the final price after the discount.
*/
let original_price;
let discount;
let result;
function discountedPrice(price, disc){
if(disc<100){
result = ((price)*((100 - disc)))/100;
}else{
result = "Please Enter valid value";
}
console.log(result);
}
discountedPrice(2000, 25);
Comments
Post a Comment