Steps to Find Even and Odd Number:
1. If number is Divisible by 2 its Even
2. If number is not Divisible by 2 its Odd
2. Mod is used to find the a number is divisible or not.
VBScript Program to Check Even or Odd:
<html>
<body>
<script type="text/vbscript">
Dim vNumber
Dim vResult
vNumber = 12
If vNumber mod 2 <>0 Then
msgbox vNumber & " is odd"
else
msgbox vNumber & " is even"
End If
</script>
</body>
</html>
Out of Above Program:
Where to Run This Program:
1. This VBScript Program code either you can use in QTP editor (code between <script> and </script> tags ) and run it.
2. Write in Notepad, save with .htm extension and run on internet explorer.
0 comments:
Post a Comment