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

function in c++

Discussion in 'C++' started by zeenat, Apr 8, 2011.

  1. zeenat

    zeenat New Member

    Joined:
    Apr 8, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    hi:p
    plz tell me how to make a function of name salaryIncrement for ten people
    displaying their old salary( input from user ) and their new salary with the increament of( 15% ) in their old salary.plz tell me
     
  2. Scaner

    Scaner New Member

    Joined:
    Mar 14, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Hi Try This I hope That Is Enough For You;

    HTML:
    #include<iostream>
    #include<conio.h>
    using namespace std ;
    float salaryIncrement()
    {
          float sal[10];
    for (int i=0 ; i<10 ; i++){
    cout<<"Please Enter The : "<<i+1<<"th "<<"person\n";
    cin>>sal[i];
    }
    
    cout<<"The Old Salary"<<"        "<<"The Increment of 15%\n";
    for (int i=0 ; i<10 ; i++ )
    {
    cout<<sal[i]<<"                 "<<(sal[i]*15/100)+sal[i]<<endl;
    }
    }
    int main()
    {
    salaryIncrement();
    getche();
    return 0 ;
    }
    
    
     
  3. zeenat

    zeenat New Member

    Joined:
    Apr 8, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Thanx:) I have just compiled the code and it works.
    thanx once again.
     

Share This Page