write a program to add and subtract 2 numbers
Answers
Answered by
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
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
Computer Science,
4 hours ago
Social Sciences,
4 hours ago
Economy,
4 hours ago
History,
8 hours ago
English,
8 hours ago
History,
8 months ago
English,
8 months ago