So, here is a question when user input 3 than it prints the 7 as output and when user input 7 than it prints 3 as output, but without using any condition and loop.
here is what I done.But the problem is i'm using 2 numbers as input but i have to done it with one input.
void main() {
print(mod(7, 3));
}
int mod(int num1, int num2) {
//3*2 mod 7
//7*2 mod 3
int answer = (num1 * 2) % num2 + 1;
return answer;
}
please help how to do this.You can use any language to solve this.