https://www.rakeshmgs.in/search/label/Template
https://www.rakeshmgs.in
RakeshMgs

Write a program to accept three Employee name and Basic salary. Print employee Net pay after calculation the following:

Updated:

एक प्रोग्राम बनाइये जिसमे तीन Employee का नाम और बेसिक सैलरी इनपुट करें, निचे दिए गए कंडीशन के अनुसार Employee का नेट पे प्रिंट करें

इसमें 3 condition ये है:
  1. यदि Employee की बेसिक सैलरी 5000 से ज्यादा है तो उसे HRA 1500 दिया जाये अन्यथा 800
  2. यदि Employee की बेसिक सैलरी 5000 से ज्यादा है तो उसे Bonus 20% दिया जाये अन्यथा 10%
  3. यदि Employee की बेसिक सैलरी 5000 से ज्यादा है तो उसे PF 15% दिया जाये अन्यथा 0

Write a program to accept three Employee name and Basic salary. Print employee Net pay after calculation the following:

  • HRA = 1500 if basic is >5000 else 800
  • BONUS = 20% of basic if Basic is >5000 else 10% of basic
  • PF = 15% of basic if basic is >5000 else 0
    screenshot

    Solve Using Python:




    Solve Using C:

    Select and press Ctrl+C

    #include 
    float calcnetpay(float basicsalery) {
        float hra, bonus, pf;
        if (basicsalery >= 5000) {
            hra = 1500;
            bonus = 20 * basicsalery/100;
            pf = 15 * basicsalery/100;
        } else {
            hra = 800;
            bonus = 10 * basicsalery / 100;
            pf = 0;
        }
        float net_pay = basicsalery + hra + bonus - pf;
        return net_pay;
    }
    int main() {
        char empname[3][50];
        float bsalery[3];
        for (int i = 0; i < 3; i++) {
            printf("Enter name of Employee %d: ", i+1);
            scanf("%s", empname[i]);
            printf("Enter basic salary of Employee %d: ", i+1);
            scanf("%f", &bsalery[i]);
        }
        for (int i = 0; i < 3; i++) {
            float net_pay = calcnetpay(bsalery[i]);
            printf("%s's net pay: %.2f\n", empname[i], net_pay);
        }
        return 0;
    }
    

    आपको आर्टिकल कैसा लगा? अपनी राय अवश्य दें
    Please don't Add spam links,
    if you want backlinks from my blog contact me on rakeshmgs.in@gmail.com