write a vb script to display the number is odd or even and
whether it is divisible by 9 or not

Answer Posted / alok

vnum=cint(inputbox("enter a number"))
if vnum=0 then
msgbox "invalid"
end if
if vnum mod 2=0 then
msgbox "even"

else msgbox "odd"
end if
if vnum mod 9=0 then
msgbox "num is divisible by 9"
else
msgbox "num is not divisible by 9"
end if

Is This Answer Correct ?    2 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is loose binding? Why is it not a good practice to use it?

809


Mention the rules for using option explicit statement?

704


What are the uses of vb script?

806


Mention the environments where vbscript could be run?

903


How do you declare a variable in vbscript?

834


Mention how to assign a date value to a variable?

824


How will you get the largest subscript of an array in vbscript?

865


Which date function is used in the vbscript language to find the difference between the 2 dates?

808


What is the use of the formatdatetime function in the vbscript language?

767


How to delete a cookie using vbscript?

800


Mention how to create a cookie using vbscript?

741


How to make professional test report using vbscript code in UFT, which gives us complete analysis of the test.

2715


Does VB/Win make standalone .EXE files?

3129


Explain vbscript in detail?

823


What is difference between vbscript and vba?

859