Skip to content

Instantly share code, notes, and snippets.

@tamboer
Created December 9, 2014 10:09
Show Gist options
  • Select an option

  • Save tamboer/07f4473f8d23c2c06352 to your computer and use it in GitHub Desktop.

Select an option

Save tamboer/07f4473f8d23c2c06352 to your computer and use it in GitHub Desktop.
Java CheckBTW
import java.util.Formatter;
import java.util.Scanner;
public class CheckBTW{
public static void main(String args[]){
System.out.print("Geef een getal: ");
Scanner sc = new Scanner(System.in);
int btwNummer = sc.nextInt();
//int btwNummer = 213252520;
int eersteSewe = btwNummer / 100;
float delen = 97F;
byte rest = (byte)(eersteSewe % delen);
byte controle = (byte)(btwNummer % 100);
System.out.println(controle == 97-rest);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment