Computer Science, asked by shambuadwaith09, 8 hours ago

write a program to add and subtract 2 numbers​

Answers

Answered by hardikpadwal1208
1

Answer:

printf("Enter two integers: "); scanf("%d %d", &number1, &number2); Then, these two numbers are added using the + operator, and the result is stored in the sum variable. Finally, the printf() function is used to display the sum of numbers. printf("%d + %d = %d", number1, number2, sum).

Answered by kdwivedi2005
0

Answer:

public class xyz

    {

        void dis(int x,y)

          {

              int sum = x+y;

              int sub = x-y;

              System.out.println("The sum of number" + sum);

              System.out.println("The subtract of number"+sub)

}

}

Note - This program is for java

Hope you like it

Please mark me as brainliest.

Similar questions