วันอังคารที่ 17 กรกฎาคม พ.ศ. 2555

ตัวอย่างโปรแกรมแบบมีเงื่อนไข


<html>
          <head>
          <script language="javascript">
          <!--
          var a;
          var b;
          a = prompt("input numberfor plus");
          a = parselnt(a);
          b = prompt("input another number");
          b = parselnt(b);
if (a > b)
          {
                    b=a-b;
                    alert(b);
          }
else
          {
                    b=a+b;
                    alert(b);
          }
          </script>
          </head>
</html>   

ไม่มีความคิดเห็น:

แสดงความคิดเห็น