Calculate Revenue

 Prompt the user for Price ( floating point number) and  Quantity (integer). Determine total revenue using the following formula: Total Revenue = Price * Quantity


#include<stdio.h>
void rev(float price,int quant);
void main()
{
    int q;
    float p;
    printf("Price=");
    scanf("%f",&p);
    printf("Quantity=");
    scanf("%d",&q);
    rev(p,q);
}
void rev(float price,int quant)
{
    float total=price*quant;
    printf("\nTotal revenue:%f",total);
}

No comments:

Post a Comment

Thank you for using this blog.