Dim n
n=inputbox ("Enter a number to display first 10 factors")
for i=1 to 10
msgbox n & " X " & i & " = " & n*i
next
Monday, March 23, 2015
Find the factorial of a given number
Dim n
n=inputbox ("Enter a number to compute factorial")
fact=1
for i=2 to n
fact=fact*i
next
msgbox "The factorial of " & n & " is " & fact
n=inputbox ("Enter a number to compute factorial")
fact=1
for i=2 to n
fact=fact*i
next
msgbox "The factorial of " & n & " is " & fact
Print even numbers in a range
Dim n
n=30
for i=1 to n
if i mod 2 = 0 then
msgbox "The number: " & i & " is even"
end if
next
n=30
for i=1 to n
if i mod 2 = 0 then
msgbox "The number: " & i & " is even"
end if
next
Find whether given number is a odd number
Dim n
n=inputbox ("Enter a number")
if n mod 2 = 0 then
msgbox "The number: " & n & " is not odd"
else
msgbox "The number: " & n & " is odd"
end if
n=inputbox ("Enter a number")
if n mod 2 = 0 then
msgbox "The number: " & n & " is not odd"
else
msgbox "The number: " & n & " is odd"
end if
Subscribe to:
Comments (Atom)
Best practices for test automation in agile software development
Agile software development is a highly iterative and collaborative approach to software development that emphasizes flexibility and a...
-
Agile software development is a highly iterative and collaborative approach to software development that emphasizes flexibility and a...
-
Test-Driven Development (TDD) is a software development approach that emphasizes writing automated tests before writing the code. The appr...
-
Artificial intelligence (AI) and machine learning (ML) are transforming the field of software testing by enabling faster and more accurate...