Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: I have problem with method in Java

  1. #1
    Junior Member
    Join Date
    Jul 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default I have problem with method in Java

    hi, any one can plz help me slove the give logic by java.


    Write a method/flowchart or step-by-step procedure to print the following sequence of numbers.

    Method should accept two parameters.
    First parameter is first number to display, second parameter should be number of rows to be printed.
    Any programming language is fine.

    printseries(firstparam,secondparam)

    Sample:
    printseries(7,4)

    Output should be:
    7
    14 15
    28 29 30 31
    56 57 58 59 60 61 62 63

    Note: Please don't simply write things like 'print 7', 'goto next line', 'print 14', 'print space', 'print 15', etc.

    THIS SEQUENCE HAS A LOGIC AND YOUR ANSWER SHOULD EXPLAIN THE LOGIC AS WELL.

    Thanks....


  2. #2
    Senior Member PhHein's Avatar
    Join Date
    Mar 2013
    Location
    Germany
    Posts
    585
    My Mood
    Sleepy
    Thanks
    10
    Thanked 87 Times in 80 Posts

    Default Re: I have problem with method in Java

    What have you tried? - Matt Gemmell
    Post your best attempt. Nobody will do it for you.

Similar Threads

  1. Set and get method problem in java
    By Shania_01 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 10th, 2013, 10:16 AM
  2. Having java return method problem
    By jayleongwk in forum Java Theory & Questions
    Replies: 2
    Last Post: November 4th, 2012, 02:09 AM
  3. [SOLVED] How to create a Java generic method, similar to a C++ template method?
    By Sharmeen in forum Object Oriented Programming
    Replies: 3
    Last Post: October 18th, 2012, 02:33 AM
  4. Simple java method problem
    By Leprechaun_hunter in forum What's Wrong With My Code?
    Replies: 5
    Last Post: April 17th, 2011, 10:39 PM
  5. Replies: 10
    Last Post: September 6th, 2010, 04:48 PM