मराठी
तामिळनाडू बोर्ड ऑफ सेकेंडरी एज्युकेशनएचएससी विज्ञान इयत्ता ११

Write a program in JavaScript to find the cube of a number using function. - Computer Applications

Advertisements
Advertisements

प्रश्न

Write a program in JavaScript to find the cube of a number using function.

थोडक्यात उत्तर

उत्तर

<html>
<head>
<title> print the cube number
</title>
</head>
<Title>
Function cube</Title>
<Script type = “text/Javascript”>
<!—
var input = window.prompt (“Enter value : ”, “0”);
var v = parselnt (input); var c = cube (v);
document, write In (“<br><h4><u> cube function </u> </h4>”);
document, write In (“Number *V* “<br> The cube =” *C);
function cube (x)
{
var cube = x* x * x; return c;
}
//–>
</script>
</head>
<body>
</body>
</html>

OUTPUT
Enter value: 5
Cube Function Number: 5
The cube: 125

shaalaa.com
JavaScript Functions
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 16: JavaScript Functions - Evaluation [पृष्ठ ३३६]

APPEARS IN

सामाचीर कलवी Computer Applications [English] Class 11 TN Board
पाठ 16 JavaScript Functions
Evaluation | Q 1. | पृष्ठ ३३६
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×