Печать
Категория: JavaScript
Просмотров: 895

Намунаи 7

<html>
<head>
<meta charset='utf-8'/>
<title>Намунаи 7</title>
</head>
<body>
<script type="text/javascript">
<!--
var a = 10;
var b = 20;

document.write("Қимати a = " + a + "<br/>");
document.write("Қимати b = " + b + "<br/>");
document.write("<br/>");

document.write("( (a > b) ? 100 : 200) => ");
result = (a > b) ? 100 : 200;
document.write(result) ;
document.write("<br/><br/>");

document.write("( (a < b) ? 100 : 200) => ");
result = (a < b) ? 100 : 200;
document.write(result) ;
document.write("<br/><br/>");

document.write("( (a >= b) ? 100 : 200) => ");
result = (a >= b) ? 100 : 200;
document.write(result) ;
document.write("<br/><br/>");

document.write("( (a <= b) ? 100 : 200) => ");
result = (a <= b) ? 100 : 200;
document.write(result) ;
document.write("<br/><br/>");

document.write("( (a == b) ? 100 : 200) => ");
result = (a == b) ? 100 : 200;
document.write(result) ;
document.write("<br/><br/>");

document.write("( (a != b) ? 100 : 200) => ");
result = (a != b) ? 100 : 200;
document.write(result) ;
document.write("<br/><br/>");
//-->
</script>
<p>Ба тағйирёбандаҳо қиматҳои гуногун бахшида, натиҷаро бинед.</p>
</body>
</html>