Why m I getting nzec error?

import java.io.*;
import java.util.Scanner;
class pub
{
public static void main(String a[])
{
double bal,n;
Scanner s=new Scanner(System.in);
while(true)
{
n=s.nextInt();
bal=s.nextInt();
bal=bal-n-0.50;
System.out.println(bal);
System.exit(0);
}
}
}

this code succesfully ran in cmd but shows nzec error…why?

1 Like

replace System.exit(0) with break; I think that is creating problem.

//