How to return an array from a function and loop through it?

前端 未结 7 1646
广开言路
广开言路 2021-01-24 08:12
#include 

int* fib(int);

int main()
{
    int count;
    std::cout<<\"enter number up to which fibonacci series is to be printed\"<

        
7条回答
  •  佛祖请我去吃肉
    2021-01-24 08:53

    Your i is not initialized. Instead of making it i = 0, you do i < 0. And in the j loop, the maximum number should be d. So j < d. Not j <= d.

提交回复
热议问题