lundi 10 octobre 2016

Modulo 10 Example anyone?

I have an assignment for my Java class, and in the program instructions. It tells us to use Modulo 10. The Assignment states: The Program Encrypts each digit by replacing it with the (sum of that digit plus 7) modulo 10.
Not sure how to use it.

This is my best attempt so far:

int i1 = 1234
int a = 10 % i1; 

System.out.println(a);

Output return: 0012

According to Assignment supposed to output 8901

What am I doing wrong?

Aucun commentaire:

Enregistrer un commentaire