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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!