How to resolve the algorithm FizzBuzz step by step in the VBScript programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm FizzBuzz step by step in the VBScript programming language
Table of Contents
Problem Statement
Write a program that prints the integers from 1 to 100 (inclusive).
But:
The FizzBuzz problem was presented as the lowest level of comprehension required to illustrate adequacy.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm FizzBuzz step by step in the VBScript programming language
Source code in the vbscript programming language
For i = 1 To 100
If i Mod 15 = 0 Then
WScript.Echo "FizzBuzz"
ElseIf i Mod 5 = 0 Then
WScript.Echo "Buzz"
ElseIf i Mod 3 = 0 Then
WScript.Echo "Fizz"
Else
WScript.Echo i
End If
Next
With WScript.StdOut
For i = 1 To 100
If i Mod 3 = 0 Then .Write "Fizz"
If i Mod 5 = 0 Then .Write "Buzz"
If .Column = 1 Then .WriteLine i Else .WriteLine ""
Next
End With
You may also check:How to resolve the algorithm Factorial step by step in the Robotic programming language
You may also check:How to resolve the algorithm Roman numerals/Encode step by step in the 8080 Assembly programming language
You may also check:How to resolve the algorithm Zig-zag matrix step by step in the Qi programming language
You may also check:How to resolve the algorithm Doubly-linked list/Traversal step by step in the Liberty BASIC programming language
You may also check:How to resolve the algorithm Stable marriage problem step by step in the XSLT 2.0 programming language