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 Pass Multiple values in functions by using vb script? Function value(arg1,arg2) N1=arg1+arg2 N2=arg1-agr2 N3=arg1*agr2 N4=arg1/arg2 Value= How to pass ? End Function

3 Answers   iGate,


what is resorceallocation

0 Answers  


In our application qtp unable to indentify the menu items,we tried number of times to add objetcs into object repository but fail. through normal recording mode only objects going to add into repository but while running same recording script qtp showing a error like " unable to indentify the object". in repository there is no any properties and pro values for that object and also i tried with virtual object config also unable to find the object in application and in repository. Then what i have to do to identify menu objects????? can anybody hell me pls..............

2 Answers   Blue Star,


can anybody tell vb script code for alphanumeric and special character .which is used in qtp the name text field.

1 Answers  


How will you get a string with the specified character the specified number of times in vbscript?

0 Answers  






Write a test case using Test if the images,a particular test exists,check if the page links match,page response is within a certain range,parameterization of the test,the test should comprise of actions,the test should use a custom function,the test should use global repository

0 Answers  


hi i am trying for testing job for 3+ experience(fake) can u suggest me what type of projects i can keep in my resume and how much of knoeledge i should have abt that project.thnks in advance.urgt plz

0 Answers  


Explain about scrrun.dll?

0 Answers  


how to validate the text in a web table

2 Answers   Mphasis,


write a vb script to display the size of the folder,date created and name of the folder

1 Answers  


How to copy from one script to another script in qtp

4 Answers  


accept a string & display whether a is present or not

1 Answers  


Categories