While the program works as expected on low numbers there is no output when input is big
I tried changing data types to longest there is (unsigned long long) which is more than required yet nothing changed. Changed from cin to scanf just to try but nothing. There is no output no error nothing I tried v it is supposed to give the remainder when nth fibonacci number is divided by changing int i to long long as well but no the said input is 9999999999999 2
#include <iostream>
#include <array>
using namespace std;
int main()
{
int m;
long long n;
scanf("%lli,%i", &n , &m);
int numbers[n];
numbers[0] = 0;
numbers[1] = 1;
for (int i = 2; i <= n; i++)
{
numbers[i] = numbers[i - 1] + numbers[i - 2];
if (numbers[i] >= m)
numbers[i] %= m;
}
cout << numbers[n];
return 0;
}