Question: Task 3: Triangular Numbers <2.2.1 While-loops> A triangular number is any number from the series of numbers (1, 3, 6, 10, 15, etc.) obtained by
Task 3:
Triangular Numbers <2.2.1 While-loops> A triangular number is any number from the series of numbers (1, 3, 6, 10, 15, etc.) obtained by continued summation of the natural numbers 1, 2, 3, 4, 5, etc.1
Implement a function next triangular number(num) that takes an integer and determines the smallest triangular number that is equal to or larger than the given number.
The function must:
take one argument: a positive integer, num
return trig num, where trig num is the smallest triangular number that is greater than or equal to num
use a while-loop
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
