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

Answers were Sorted based on User's Feedback



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

Answer / mudaseer

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 ?    16 Yes 3 No

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

Answer / 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

More VB Script Interview Questions

how to find the textfile in the folder and copy file from one folder to another folder useing parameterigation in QTP

1 Answers   Accenture,


How will you convert a given number to long in vbscript?

0 Answers  


What methods are used to create text files and open text files in the vbscript language?

0 Answers  


write a vb-script code to delete all the mails in my gmail in the year 2011

1 Answers  


How do you declare a variable in vbscript?

0 Answers  


how do you make the variable declaration mandatory?what is the use of "option explicit"?

2 Answers  


When does ‘on click of button’ event gets triggered in the vbscript language?

0 Answers  


Which object provide information about a single runtime error in a vbscript?

0 Answers  


The function template cocept is implemented in vb.net is ???

0 Answers  


What is the difference between ByRef and ByVal. When to use ByRef and ByVal

5 Answers   Polaris, TCS,


pls tell me which is good book or site for vbscript?

1 Answers   Mind Tree,


How to add actions in driver script to run those actions in QTP?

0 Answers  


Categories