Write a program to find the sum and difference between 17 and 2 using variables
Answers
Answered by
12
Answer:
class findSorD
{
public static void main (String args[])
{
int a = 17;
int b = 2;
int sum = a+b;
int diff = a-b;
System.out.println("Sum of 17 and 2 is" + sum);
System.out.println("Difference of 17 and 2 is" + diff);
}
}
Answered by
17
Hey, here ya go..!
Answer:
class sum
{
public static void main (String args[])
{
int var1=17;
int var2= 2;
int s= var1+var2;
int d= var1-var2;
System.out.println("The sum of the given two numbers is:" + s);
System.out.println("The difference of the given two numbers is:"+ d);
}
}
Similar questions
Math,
5 months ago
Math,
5 months ago
Social Sciences,
5 months ago
Biology,
11 months ago
Hindi,
1 year ago