🔒 Closed C po pa help

Status
Not open for further replies.

zacha

Forum Veteran
1652899567555.webp

ito po mga paps
 
C:
#include<stdio.h>


void main()
{

    float salary, tax=0;
    printf("Enter Gross Monthly Salary: ");
    scanf_s("%f", &salary);


    if (salary <= 20832)//S1
    {
        tax = 0;
    }
    if ((salary > 20832) && (salary < 33333))//S2
    {
        tax = (salary - 20833) * 0.20;
    }
    if ((salary > 33332) && (salary < 66667))//S3
    {
        tax = 2500 + (salary - 33333) * 0.25;
    }
    if ((salary > 66666) && (salary < 166667))//S4
    {
        tax = 10833.33 + (salary - 66667) * 0.30;
    }
    if (salary > 166666)
    {
        tax = 40833.33 + (salary - 166667) * 0.32;
    }


    printf("\n Tax is %.2f", tax);
    printf("\n Net monthly salary: %.2f", salary - tax);

    getch();
    getch();
}

Di ako sure sa formula ha
 
C:
#include<stdio.h>


void main()
{

    float salary, tax=0;
    printf("Enter Gross Monthly Salary: ");
    scanf_s("%f", &salary);


    if (salary <= 20832)//S1
    {
        tax = 0;
    }
    if ((salary > 20832) && (salary < 33333))//S2
    {
        tax = (salary - 20833) * 0.20;
    }
    if ((salary > 33332) && (salary < 66667))//S3
    {
        tax = 2500 + (salary - 33333) * 0.25;
    }
    if ((salary > 66666) && (salary < 166667))//S4
    {
        tax = 10833.33 + (salary - 66667) * 0.30;
    }
    if (salary > 166666)
    {
        tax = 40833.33 + (salary - 166667) * 0.32;
    }


    printf("\n Tax is %.2f", tax);
    printf("\n Net monthly salary: %.2f", salary - tax);

    getch();
    getch();
}

Di ako sure sa formula ha
salamat paps

C:
#include<stdio.h>


void main()
{

    float salary, tax=0;
    printf("Enter Gross Monthly Salary: ");
    scanf_s("%f", &salary);


    if (salary <= 20832)//S1
    {
        tax = 0;
    }
    if ((salary > 20832) && (salary < 33333))//S2
    {
        tax = (salary - 20833) * 0.20;
    }
    if ((salary > 33332) && (salary < 66667))//S3
    {
        tax = 2500 + (salary - 33333) * 0.25;
    }
    if ((salary > 66666) && (salary < 166667))//S4
    {
        tax = 10833.33 + (salary - 66667) * 0.30;
    }
    if (salary > 166666)
    {
        tax = 40833.33 + (salary - 166667) * 0.32;
    }


    printf("\n Tax is %.2f", tax);
    printf("\n Net monthly salary: %.2f", salary - tax);

    getch();
    getch();
}

Di ako sure sa formula ha
pwede pa tulong paps nahihirapan kasi ako sa subject na to. meron akong bagong post. salamat paps
 
Status
Not open for further replies.

Similar threads

About this Thread

  • 3
    Replies
  • 376
    Views
  • 3
    Participants
Last reply from:
zacha

Trending Topics

Online now

Members online
1,251
Guests online
750
Total visitors
2,001

Forum statistics

Threads
2,281,021
Posts
29,000,937
Members
1,225,100
Latest member
GAmingHub
Back
Top