swirly
Active Member
- Messages
- 1,930
- Reaction score
- 0
- Points
- 36
I'm guessing this is the right place. I ned help with an assignment. I have to write a program in JAVA. I just need to know how to concantenate 3 integers.
proof=square%square;
should be proof=abc(concantenated)%square; Then it needs to check if the remainder is anything but 0.
Code:
class SumDigit
{ public static void main(String args[])
{
int proof=0;
for(int a=1; a<=9; a++)
{
for(int b=0; b<=9; b++)
{
for(int c=0; c<=9; c++)
{
int sum=a+b+c;
int square=sum*sum;
proof=square%square;
}
}
}
System.out.print(proof);
}
}
should be proof=abc(concantenated)%square; Then it needs to check if the remainder is anything but 0.
Last edited: