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 write function to validate the number of characters entering into the text box?

2 Answers   TCS,


Could Anybody tell me the VBscript for REVERSE an Integer int reverse(int num) Ex:246 to 642

7 Answers   Amazon,


How to find arry size in qtp vb script

2 Answers   Cap Gemini,


Suppose by navigation I went from 1 st page to 5 page ,so Write a generic script for coming from any page to the 1st page and by executing where the page may be it will come to 1st page

1 Answers   CybAge,


Why to add checkpoint in QTP What's the purpose of checkpoints & how to add it

2 Answers  






hai all.iam chandu..please let me know how to test a link in QTP when it is changing at run time..and what property we should take while we r using descriptive programming for a link..

6 Answers  


write a vb script to open a text file and write into it

2 Answers  


Mention what is the main difference between function and sub-procedure?

0 Answers  


How are arrays declared in the vbscript language?

0 Answers  


What is vbscript procedures?

0 Answers  


Explain the extension .hta?

0 Answers  


What are the different types of operators and their order of precedence?

0 Answers  


Categories