Science, asked by saritayadav96000, 5 months ago

Write a java program to find the sum and difference between 25 and 16 using variables, in different lines.​

Answers

Answered by ayushdasgupta
4

Answer:

Please mark me brainliest! Here is your answer:

Explanation:

//program to find the sum and difference between two numbers

public class Example

{

      public static void main(String args[])

      {

            int a=25,b=16;

            System.out.println("The first number="+a);

            System.out.println("The second number="+b);

            double sum=a+b;

            double difference=a-b;

            System.out.println("The sum="+sum);

            System.out.println("The difference="+difference);

        }

}

Answered by ARMY0308
0

Answer:

HERE IS YOUR ANSWER↓

Explanation:

class PROGRAM1

{

   static void main()

   {

       int a = 25;

       int b = 16;

       int c = a+b;

       int d = a-b;

       System.out.println("THE SUM IS="+c);

       System.out.println("THE DIFFERENCE="+d);

   }

}

Similar questions
Math, 10 months ago