Monday, October 19, 2020

c program of salary net pay with discount

First Method:

#include <stdio.h>

int main() {

    float n, d, np;

    printf("Enter a number:");

    scanf("%f", &n);

    d = n * 0.10;

    np = n - d;

    printf("Pay Rs = %.2f", np);

    return 0;

}


Second Method:

#include <stdio.h>

int main() {

    float np;

    printf("Enter a number:");

    scanf("%f", &np);

    np = np - (np * 0.10);

    printf("Pay Rs = %.2f", np);

    return 0;

}


Third Method:

#include <stdio.h>

int main() {

    float np;

    printf("Enter a number:");

    scanf("%f", &np);

    printf("Pay Rs = %.2f, np * 0.9);

    return 0;

}

No comments:

Post a Comment

Finding Direction: Navigating Career Goals and Life Aspirations

  Finding Direction: Navigating Career Goals and Life Aspirations Life often presents us with a myriad of choices, and the path to fulfillme...