# My speed is 0 a positive integer

Posted on

Apr 17,  · Function or loop to accept only positive. Function or loop to accept only positive numbers? marblesmike. Hey guys, { // prompts the user for a non-negative number (>= 0) // reads in the number and check // keeps re-prompting user if the input is invalid (negative) // returns the non-negative input do { cout. Given the positive integer distance and the positive integer n, associate the variable sum with the sum of the elements of the arithmetic progression from 1 to n with distance distance. For example, if distance is 2 and n is 10, then sum would be associated with 25 because 1+3+5+7+9 = Jun 17,  · I'm doing this maths question where one of the conditions for it is that the number be a positive integer. The only number that works is zero, so is it a positive integer (and the answer is zero) or is it not (and the question is unsolvable/not possible/there is no answer) Explanation would be nice Thanks in a AdvanceStatus: Resolved.