0
assignment operator
can you give me a code that I will input 2 numbers and display a result in all assignment operator symbol.. example: I input 30 and 40 int a is 30 , int b is 40 and c = 0 output is c = a + b = "the result<--" c += a = c -= a = c *= a = c /= a = c %= a = etc...
2 odpowiedzi
+ 2
This takes 2 inputs for the numbers and outputs the result. tweak it to your needs
import java.util.*;
import java.util.Scanner;
class Dcoder
{
public static void main(String args[])
{
Scanner scan = new Scanner(System.in);
int a=scan.nextInt();
int b=scan.nextInt();
System.out.println(one+two);
System.out.println(one-two);
}
}
+ 2
cout << c + a << ',' << ... << c % a;