Friday, October 23, 2020

Based on the work experience and grade, calculate the net salary in C.

#include <stdio.h>

int main() 

{

    float s,e;

    char g;

    printf("Enter s,e,g");

    scanf("%f %f %c",&s,&e,&g);

    if(e>=5)

    {

        if(g=='a'||g=='A')

        {

            s=s*2;

        }

        else if(g=='B'||g=='b')

        {

            s=s*1.75;

        }

        else if(g=='c'||g=='C')

        {

            s=s*1.60;

        }

        

        else if(g=='D'||g=='d')

        {

            s=s*1.50;

        }

        else

        {

            s=s*1.25;

        }

    }

printf("Net Salary:%.2f",s);

}

No comments:

Post a Comment

Document Your Life Before It Makes Sense

  This message is for all the students who are in school may 10th, 11th or 12th grade or in college one of the year of many or graduate ones...