1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can anyone help me with this C coding

Discussion in 'BlackHat Lounge' started by veboo, Apr 28, 2015.

  1. veboo

    veboo Jr. VIP Jr. VIP

    Joined:
    Aug 22, 2014
    Messages:
    1,096
    Likes Received:
    681
    Adios,

    I'm a Zero level noob in C language and do self studying these days. What I need to know is just a simple coding.

    The user inputs the name and the basic salary and the netsalary is calculated likewise

    Netsalary= basic salary+(basic Salary*0.5)

    I know how to do this in simple programming but I'm starting mess when I try to do it with Calling a Function. Can Anyone help with the following code I've written?

    When it compiles and error pops up saying that the "calculateNetsalary" has not been declared. It's the function name and I'm stuck right there.
    Please someone help me!

     
  2. ytcommenter

    ytcommenter Power Member

    Joined:
    Feb 13, 2010
    Messages:
    631
    Likes Received:
    124
    After including header file add following line

    float calculateNetsalary(float basicSalary);
     
    • Thanks Thanks x 1
  3. veboo

    veboo Jr. VIP Jr. VIP

    Joined:
    Aug 22, 2014
    Messages:
    1,096
    Likes Received:
    681
    Thanks mate. Got Passed It but the output is not accurate now :D :D :D :D :D :D

    The output is only showing "Hi 0.0000"
     
  4. ytcommenter

    ytcommenter Power Member

    Joined:
    Feb 13, 2010
    Messages:
    631
    Likes Received:
    124
    for string input use

    gets(name); instead of scanf("%s",&name);