How to resolve the algorithm Averages/Root mean square step by step in the S-BASIC programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Averages/Root mean square step by step in the S-BASIC programming language

Table of Contents

Problem Statement

Compute the   Root mean square   of the numbers 1..10.

The   root mean square   is also known by its initials RMS (or rms), and as the quadratic mean. The RMS is calculated as the mean of the squares of the numbers, square-rooted:

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Averages/Root mean square step by step in the S-BASIC programming language

Source code in the s-basic programming language

var n, sqsum, sqmean, rms = real
sqsum = 0
for n = 1 to 10 do
  sqsum = sqsum + (n * n)
next n
sqmean = sqsum / n
rms = sqr(sqmean)
print "RMS of numbers from 1 to 10 = ";rms

end


  

You may also check:How to resolve the algorithm Repeat a string step by step in the Racket programming language
You may also check:How to resolve the algorithm Averages/Mean time of day step by step in the PicoLisp programming language
You may also check:How to resolve the algorithm Leap year step by step in the 8080 Assembly programming language
You may also check:How to resolve the algorithm Array length step by step in the Bash programming language
You may also check:How to resolve the algorithm Entropy step by step in the C programming language