Monday, October 19, 2020

c program of bonus in net salary

First Method:
#include <stdio.h>
int main() {
    float s, b, ns;
    printf("Enter salary:");
    scanf("%f", &s);
    b = s * 0.50;
    ns = s + b;
    printf("Net Salary = %.2f", ns);
    return 0;
}

Second Method:
#include <stdio.h>
int main() {
    float ns;
    printf("Enter salary:");
    scanf("%f", &s);
    ns = ns + (ns * 0.50);
    printf("Net Salary = %.2f", ns);
    return 0;
}

Third Method:
#include <stdio.h>
int main() {
    float ns;
    printf("Enter salary:");
    scanf("%f", &s);
    printf("Net Salary = %.2f", ns * 0.5);
    return 0;
}

No comments:

Post a Comment

From a Mother’s Passion to Real Impact: 20+ Years of Quiet Consistency

 my mom has been doing research on every products since more than 20 years along with managing family of around 20 members and upbringing me...