I don't understand what is wrong with my code and why it produces error:
variable k might not have been initialized
import java.util.*;
public class kk
{
public static void main(String [] args)
{
Scanner scan=new Scanner(System.in);
int m=scan.nextInt();
for(int q=0;q<m;q++)
{
int a=scan.nextInt();
int b=scan.nextInt();
int n=scan.nextInt();
scan.close();
int k;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=i;j++)
{
k=j*b;
}
k=k+a;
System.out.println(k);
k=0;
}}
}
}