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

All Quotes

 Quote 53: Ethical earning is key. Quote 52: Grades matter, but your skills, curiosity, and consistency matter even more. Quote 51: Be curio...