Thread: solve this problem...

  1. #1
    Registered User
    Join Date
    Aug 2016
    Posts
    1

    solve this problem...

    1.Write a program to find the sum of the values in a numeric field of the elements of an array of structures.

    2.The total number of moves of disks required to solve the Tower of Hanoi problem with n disks is expressed in the following equation:
    Hn = 2Hn-1 +1, for n>1 and H1 = 1.
    Write a program that finds the total number of moves for any given number n of disks using global variables, recursion and static variables separately. Write three different functions that are called from the ‘main’.

  2. #2
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,907
    And...solved! That was fun, but a bit easy.

    Oh, wait...did you want us to give you a solution? Sorry, we don't do that here. Clearly you didn't read the forum guidelines or homework policy. Strange, because to become a member, you are required to read and abide by them.

    All smart-ass-ness aside, we're happy to help you. But help does not mean we write code for you. You make an effort to solve the problems, and you post your attempt here. Make sure you paste your code as plain-text, that it's well-formatted, and in [code][/code] tags.

    Note that if you can not solve the problem yourself, you will never program a computer to solve it. So your first step to any programming problem is to understand the problem and devise a solution yourself. Then you can begin to translate that solution to code. Just work on one small piece at a time, and test after each little bit to make sure you aren't introducing errors; if you do find a problem in testing, you only have a small bit of code to debug.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. c problem to solve
    By Allan Baldejo in forum C Programming
    Replies: 4
    Last Post: 01-13-2016, 05:49 AM
  2. how to solve this problem
    By lovelycse in forum C Programming
    Replies: 18
    Last Post: 08-29-2012, 03:53 PM
  3. Please help me to solve this IO problem.
    By nichya88 in forum C++ Programming
    Replies: 2
    Last Post: 01-19-2010, 12:15 PM
  4. Would someone solve my problem?
    By Lonners in forum C Programming
    Replies: 9
    Last Post: 01-19-2008, 06:58 PM
  5. problem cant solve please help.
    By sarah in forum C Programming
    Replies: 6
    Last Post: 09-03-2001, 01:32 PM

Tags for this Thread