Home TechnologyProgrammingJava Subscribe to RSS

How To Create A Java Program That Will Create The Sum Six Numbers?

Answer Question

1 Answer - Sort by: Date | Rating

    A java Program to compute the sum of six numbers?

    public class Computer
    {
      public static void main( String [] args)
      {

        int sum = 0;
        
        for(int i = 0; i < 6; i++)
        {
          sum += Integer.parseInt(args[i]);
        }
       System.out.println sum of your numbers is: " + sum);
      }
    }

    I could have done better than this, but this should work for the basic purpose.
    0 0

    Jamesy 

    answered 7 months ago

      Answer Question - Answers are editable for 5 min.

      If you do not Sign-in or Register your answers will

      be anonymous, your answers may also be

      checked before going online.

      0

      More

         
         

        Ask a Question via Twitter

        Send a question to @askblurtit and we will publish it online and send you a reply everytime you receive an answer.

        Blurtit Store

        Get T-shirts, hoodies, caps and more at the Blurtit store

        Blurtit International