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

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

0 Answers  


Write a program to create a Dynamic array of size 5 elements and display all the elements.

1 Answers  


What aspects of vbscript make it safe so that a web page using vbscript cannot destroy or corrupt information on a user's computer?

0 Answers  


how to set one column as primary key in QTP and fetch values accordingly

0 Answers   Ford,


int a=4857 i need output as 7584.without using any inbuild function?

6 Answers   Aspire,






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

0 Answers  


What are subprocedures in vbscript?

0 Answers  


what is fire event method in qtp?

3 Answers   TCS,


Explain about the support of asp for vb script functionality?

0 Answers  


what is the function to get the ascii value of the character?

6 Answers   Netxcell, Oracle,


How can I write HTML text to the window in VB Script?

2 Answers  


write a vb script to display calculator using case statement?

1 Answers  


Categories