Computer Science, asked by Lahaayon, 11 months ago

Write a program to find the sum and difference between 17 and 2 using variables

Answers

Answered by AshStyles
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 PranathP
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