Functions and structured programming ^_^

Discussion in 'C' started by zachry00, Sep 28, 2011.

  1. zachry00

    zachry00 New Member

    Joined:
    Jul 20, 2011
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    0
    can you help me with this one?..

    (functions and structured programming)
    write a program that accepts a long num. in the main prog. and produces several outputs through the functions described below. supply appropriate parameters.


    1. Sum_Even_Digits(...)
    given the value of num, this function should return the sum of even digits to the main program.The sum of even digits must be displayed in the main program.
    2.base9 (...)
    given the value of num, this function should return the base 9 equivalent to the main program. The base 9 equivalent must be displayed in the main program.
    3.Exchange(....)
    given the value of num, this function should return the number with the first and last digits exchanged, to the main program. The changed number must be displayed in the main program.

    Sample Run:

    Enter Number: 12345
    sum of even digits : 6
    Base9: 17836
    Exchange : 52341

    your answers are greatly appriciated. thanks.
     
  2. zachry00

    zachry00 New Member

    Joined:
    Jul 20, 2011
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    0
    please help me
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice