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

How to Fight Overthinking or Negative Thoughts?

How to Combat Overthinking or Negative Thoughts? 1. Don’t Fight Your Thoughts Trying to suppress or control negative thoughts often backfire...