Friday, May 24, 2013

praktikum pweb: contoh program operasi aritmatika menggunakan javascript



<html>
<head>
<title>Operasi Aritmatik</title>
</head>
<body>
<p>
<script language="JavaScript">
<!--
document.writeln("<PRE>");
document.writeln("<h1>Operasi Aritmatik</h1>");
var A="100";
var B="200";
var C=300;
var D=400;
var E=A+B;
document.writeln(' "100"+"200"= '+E);
E=B+C;
document.writeln('"200"+300='+E);
E=C+D;
document.writeln('300+400='+E);
document.writeln("</PRE>");
//-->
</script></p>
</body>
</html>

Hasil running:



jika ada yang ingin ditanyakan, silakan komen saja ya :D

No comments:

Post a Comment