Whats wrong with my code…its showing runtime error…

#include<stdio.h>

int main()

{

long i,a,b,k,n,max=0,min=0;

int t;

scanf("%d",&t);

while(t–)

{

max=0;min=0;a=0;b=0;k=0;

scanf("%ld %ld %ld",a,b,n);

while(n<=30)

{

for(i=1;i<=n;i++)

{

if(i%2==0)

{

b=b*2;
}
else
{
a=a*2;

}

}

if(a>b)

{

max=a;

min=b;

}

else

{

max=b;

min=a;

}

k=max/min;

printf("%ld",k);

}

}

return 0;

}