Check whether given Number is Even or Odd?

Answers were Sorted based on User's Feedback



Check whether given Number is Even or Odd?..

Answer / styxopty


i = cint(inputbox ("Enter any Number to check Even or Odd"))
if i mod 2 = 0 Then
msgbox i&" is Even"

else
msgbox i&" is Odd"
end if

Is This Answer Correct ?    6 Yes 3 No

Check whether given Number is Even or Odd?..

Answer / subhani

No = Inputbox("Enter a number to check whether it is Odd or Even")

If no mod 2 = 0 then
 msgbox no & " is even."
else
 msgbox no & " is odd."
end if

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More VB Script Interview Questions

If a calulator having 3 buttons (of any number)in 3 of them one is not working properly due to which answer is wrong always. write a script to find out which button is not working properly ?

0 Answers  


explain with example primitive data types of vb script.

1 Answers  


Capture the Unique label changes on google home page for I am feeling lucky button and save those label changes to Notepad Note: Using QTP

0 Answers   Quest,


What are the uses of vb script?

0 Answers  


how to answer "TELL ME ABOUT UR SELF" as exp.person. whr to start and whr to stop. can anyone tel me

0 Answers  






Whenever I use Wscript.Echo Qtp raising Run time error as 'Object required for Wscript' How I can create object for Wscript

1 Answers  


w r p syed then output was deys and click eysd and click ysde and click sdey and click deys and click eysd............

2 Answers   Cap Gemini, iGate,


how to write code: to check whether the window of an Application Under Test exist or not . plz give with example

2 Answers  


How to Import data from a file (file is on the desktop) to the data table

0 Answers   IBM,


Here in my automation tool, i am retreiving some values and i need to store this values in the excel. How can i achieve this?. We are using VBA as scripting language. please let me know if you require any further inputs.

1 Answers  


Differentiate javascript and vbscript?

0 Answers  


How to copy from one script to another script in qtp

4 Answers  


Categories