Hi,
I have a task where I have to write a function with return value int, but without parameters, something like this:
I have to write a function which will every time return a new prime number, so I have to use static variable. The first time I "call" the function it has to return 2, the second time 3, the third 5, and etc.Code:int prime_number () {. . .}
I have to use this function to calculate the sum of numbers. I know how to calculate that sum, but I don't know to write that function.I and can't use any other function that will return or determine prime number.
Thanks in advance