Friday, March 28, 2014

Get Sales per week of a person in pounds. 200 pounds is the salary of that person in a week and he will get 9% comission on his total sale in a week. Calculate the total salary per week of that person. Use while loop

#include<stdio.h>
#include<stdlib.h>
void line()
{
int i,j;
printf("\n");
for(i=1;i<=42;i++)
printf("=");
}
void header()
{
printf("\n");
printf("Built and Designed by Arslan Malik\n\n www.CworldbyAS.blogspot.com");
printf("\n");
}
int main()
{
line();
header();
line();

    float sales;

    while(sales!=-1)
    {
        printf("\nSales per week of a person in pounds(-1 to end) : ");
        scanf("%f",&sales);
        if(sales==-1)
            break;
        else
        printf("\nIncome of that person : %.2f\n",sales/100*9+200);
        sales++;


    }


return 0;
}

No comments:

Post a Comment