could anyone tell me what is the output of (x modulus 10) in java; if x is a positive integer number from 1 (inclusive) to 9 (inclusive) ? I wrote this code to see what it could be but got nothing:
for(int i=1;i<10;++i)
{
int y = (i%10);
System.out.println("y is:" + y);
}
If you want to test Java code and don’t have access to a development environment, you can still use a public service like ideone.com. I did that for you over here. Your program prints