Skip to content

Instantly share code, notes, and snippets.

@borensoren
Created October 9, 2012 13:15
Show Gist options
  • Save borensoren/3858740 to your computer and use it in GitHub Desktop.
Save borensoren/3858740 to your computer and use it in GitHub Desktop.
for (int i = 7; i <= 0; i--)
{
if (i%2==0)
{
int a = creditCard.charAt(i);
evenDigits = evenDigits + a;
}
else
{
int a = creditCard.charAt(i);
oddDigits = oddDigits + a;
}
}
oddDigits = oddDigits * 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment