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)
AI in Software Testing: How Artificial Intelligence Is Transforming QA
For years, software testing has lived under pressure: more features, faster releases, fewer bugs, smaller teams. Traditional QA has done her...
-
Test-Driven Development (TDD) is a software development approach that emphasizes writing automated tests before writing the code. The appr...
-
Agile software development is a highly iterative and collaborative approach to software development that emphasizes flexibility and a...
-
Software development is a complex process that requires a high degree of accuracy, efficiency, and speed. One way to achieve these goals i...