Functions with Return Value tutorial in JavaScript
<!DOCTYPE html>
<html lang="en">
<html>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Functions with Return Value</title>
<script>
function fullname(fname = "Ram", lname = "Charan") {
var a = fname + " " + lname;
return a;
}
var fn = fullname("Hello", "World<br>");
document.write(fn);
function sum(maths, english, science) {
var s = maths + english + science;
return s;
}
function percentage(tt) {
var per = tt / 300 * 100;
document.write(per);
}
var total = sum(55, 65, 75);
percentage(total);
</script>
</html>
<body>
</body>
.png)
.png)
Comments
Post a Comment