Results 1 to 6 of 6
  1. #1
    codoholic is offline Member
    Join Date
    Sep 2013
    Posts
    2
    Rep Power
    0

    Default Java puzzle Help needed

    Write a Program which takes ‘n’ non-zero Integer arguments where n>3.
    You need to use n-1 arguments in the same order to have the result as the nth argument by applying any of the arithmetic operators [ + , - , * , / ].
    Assume all the operators will have same precedence.

    Example 1:
    Given n = 5 numbers are
    1 2 3 4 20
    Solution has to be provided in such a way that output should be as below
    1 * 2 + 3 * 4 = 20

    Example 2:
    Given n = 3 numbers are
    10 2 5

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,955
    Rep Power
    8

    Default Re: Java puzzle Help needed

    Did you have a question, or did you just want to post your homework?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,955
    Rep Power
    8

    Default Re: Java puzzle Help needed

    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  4. #4
    codoholic is offline Member
    Join Date
    Sep 2013
    Posts
    2
    Rep Power
    0

    Default Re: Java puzzle Help needed

    I want the solution of this puzzle

  5. #5
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,595
    Rep Power
    5

    Default Re: Java puzzle Help needed

    This forum is not a code factory. We will help you debug your existing code or answer general questions regarding Java related topics.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  6. #6
    gimbal2 is online now Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,976
    Rep Power
    5

    Default Re: Java puzzle Help needed

    Quote Originally Posted by codoholic View Post
    I want the solution of this puzzle
    For someone calling himself codoholic, you don't do much actual coding. The cake is a lie.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. java programming puzzle
    By taha emara in forum Forum Lobby
    Replies: 2
    Last Post: 01-06-2013, 12:55 AM
  2. java programming puzzle
    By taha emara in forum New To Java
    Replies: 1
    Last Post: 01-06-2013, 12:50 AM
  3. Java Wordsearch puzzle method 2 - newbie
    By lannie1980 in forum New To Java
    Replies: 51
    Last Post: 03-08-2012, 03:44 PM
  4. Friday night java puzzle
    By niu_niu in forum New To Java
    Replies: 12
    Last Post: 06-19-2010, 10:54 PM
  5. Java Drawing PUZZLE
    By Cyorxamp in forum AWT / Swing
    Replies: 3
    Last Post: 06-09-2008, 10:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •