Ad Code

Responsive Advertisement

1038 - Snack

Author: Ismail Hosen

Daffodil International University





Problem Link

//Please follow from main function

#include <stdio.h>

#include <stdlib.h>



int main()

{

    int x, y;

    double q;

    scanf("%d %d", &x, &y);

    if(x==1)

    {

        q=(y*4.00);

        printf("Total: R$ %.2lf\n", q);

    }

    else if(x==2)

    {

        q=(y*4.50);

        printf("Total: R$ %.2lf\n", q);

    }

    else if(x==3)

    {

        q=(y*5.00);

        printf("Total: R$ %.2lf\n", q);

    }

    else if(x==4)

    {

        q=(y*2.00);

        printf("Total: R$ %.2lf\n", q);

    }

    else if(x==5)

    {

        q=(y*1.50);

        printf("Total: R$ %.2lf\n", q);

    }



    return 0;

}




Post a Comment

0 Comments