java - How to reassign a value of variable to another variable after a count -


i have code count starting variable "d" (which can assigned integer value 1-7) , counting "n" times (which can integer). count loops "1" once count reaches "7" , assigns end value different variable "j". example if "5" entered "d" , "10" entered "n", counts in following manner..

"6712345671" (a total of 10 times)

then assigns value of last integer "1" variable "j".

what need reassign value of "j" "d". current code listed below...

code

public void incrementday3() {    int i;   int j = 0;    for(i = d;i < (d + n);i++)   {      j = ((i % 7) + 1);   }   system.out.print(j);      } 

any appreciated! thank you!

after

 for(i = d;i < (d + n);i++)   {      j = ((i % 7) + 1);   } 

then write

d = j; 

Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -