Wednesday, February 8, 2017

Gaussian Algorithm

Remember gaussian addition? Well I sure don't. In the the gaussian system, a simple way to add the number 1 - 100 is used. The algorithm in the program is a used to do that. It is a while loop that uses different parameters to loop until the range is reached. A variable 'first number' is equal the variable 'total', which pops in zero. A variable 'last number' is set equal to 'total', which pops in nothing. A variable gauss number is set to sum of 'first number' and 'last number'. A variable 'total sum' is set to 'total sum' plus one. By having this algorithm be a while loop,  all of these continuously run until the set range has been met.

No comments:

Post a Comment