Sunday 8 November 2020

Write a program to read two number from command line argument and add them.

 

 

Write  a program to read two number from command line argument and add them.

 

 

Program:-

 

class Sum 

{

    public static void main(String ar[])

      {

         int x, y,s;

         x = integer.parselnt(ar[0]);

         y = integer.parselnt(ar[1]);

         s = x+y;

         System.out.println("sum of "+x+" and"+y+" is " +s);

 

       

       }

  }

   

 

 


No comments:

Post a Comment

Student Marks Calculation app using java

      import javax.swing. *; import java.awt.event.ActionEvent ; import java.awt.event.ActionListener ; public class Student { private J...