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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is resorceallocation

1986


Mention when to use function procedures and what are its characteristics?

864


please can you help me to get a code of flames using a visual basic 6

1466


What is the scope of a constant declared using public?

764


Explain about vb script?

991


Mention what is the use of option explicit in vbscript?

787


why do u choose to go for testing why cant for devoloping

1855


Mention if qtp generates vbscript code as we record actions, can't it possible to directly write using vbscript code when qtp does the same thing too?

794


How will you get the exponent of the given number in vbscript?

811


Explain a few date functions in vbscript

784


Write a code to print numbers from 5 to 0?

941


if u ve resrevation for train and u get a number supose 1234xxxokie.after sucessul entering all required fields. now u put that number in search and want to chk wether these ar same or not if both ar same then its okie otherwise test fail.what would be the vb script code for it to compare these two values of different page.

1669


HOw we can apply web service checkpoint in QTP 9.5? I tried it out with net connection also. But not getting success.

2286


Explain How do you create a recordset object in vbscript?

819


What are the differences between sub procedures and function procedures?

765