Why this code shows wrong?

Can anyone tell me why this code is not passed in Problem Code : INTEST ?

#include<iostream>
using namespace std;

int main()
{
    int cases,numb,flag,temp;
    cin>>cases>>numb;

    for (int i = 0; i<cases; i++)
    {
        cin>>temp;
        if (temp%numb == 0)
        {flag++;}
    }
    cout<<flag;
    return 0;
}

Pay attention to compiler warnings! :slight_smile:

[simon@simon-laptop][18:00:43]
[~/devel/hackerrank/otherpeoples]>./compile-latest-cpp.sh 
Compiling iter8-INTEST.cpp
Executing command:
  g++ -std=c++17 iter8-INTEST.cpp -O3 -g3 -Wall -Wextra -Wconversion -DONLINE_JUDGE -D_GLIBCXX_DEBUG    -fsanitize=undefined -ftrapv
iter8-INTEST.cpp: In function ‘int main()’:
iter8-INTEST.cpp:15:11: warning: ‘flag’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   15 |     cout<<flag;
      |           ^~~~
Successful