hey…i am getting Run time error…plzz…help…though using Sieve

my code is

#include

#include<math.h>

using namespace std;

int main()

{

int a,b,c,i,j,k,d,u;

float g;

cin>>d;

for(k=0;k<d;k++)

{

```
cin>>u;
cin>>a;
```

g=a;

bool m[a];

for(i=2;i<=a;i++)

{

m[i]=true;

}float z;int q;

z=sqrt(g);

for(i=2;i<=z;i++)

{

if(m[i]==true)

{

for(j=0;;j++)

{

q=(i*i)+(j*i);

if(q<=a)

m[q]=false;

else

break;

}

}

}

for(i=2;i<=a;i++)

{

if((m[i]==true)&&(i>=u))

cout<<i<<"\n";

}

cout<<"\n";

}

return 0;

}