Thread: multiplication table without for loop

  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    2

    multiplication table without for loop

    hi,I have some trouble with multiplication table and I have to write it with if without using for or while loop.two inputs are required int i=2,j=3;
    output will be like this:
    1*2=2
    2*2=4
    3*2=6
    thank you..

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Recursion?
    Using goto?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Mar 2008
    Posts
    2
    the only restriction in using loops

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    That sort of eliminates the "goto" solution, and leaves recursion, I would think.

    As long as your numbers on either side aren't going to be huge there should be no problem with solving this using recursion.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Multiplication table
    By freddyvorhees in forum C++ Programming
    Replies: 6
    Last Post: 08-02-2008, 11:09 AM
  2. Writing array, to file
    By zootreeves in forum C Programming
    Replies: 9
    Last Post: 09-08-2007, 05:06 PM
  3. multiplication table
    By SpEkTrE in forum C Programming
    Replies: 2
    Last Post: 12-09-2003, 04:46 PM
  4. Multiplication Table Error
    By Okiesmokie in forum C++ Programming
    Replies: 3
    Last Post: 01-10-2002, 03:31 PM