Subscribe

RSS Feed (xml)

Monday, March 8, 2010

Write a C program to find the commission on a salesman's total sales

Full Question:
                      The commission on a salesman’s total sales is as follows:
a) If sales <100, then there is no commission.

b) If 100>= sales <=500, then commission = 10% of sales.

c) If sales > 500, then commission = 100+8% of sales above 500

Solution:-

#include< stdio.h>
#include< conio.h>
int main( )
{
int sales;
float comm;
clrscr( );
printf("Enter the total sales:");
scanf("%d", &sales);
if(sales<100)
printf("\nSorry no Commission, please do more sales");
else if(sales>=100 && sales<=500)
printf("\nCommission : %f ", (sales*0.1));
else
{
comm=(sales-500)*0.08;
printf("\nCommission : %f ", (comm+100));
}
getch( );
return 0;
}

15 comments:

  1. Nice! You can also try C code champ for several C programs, codes and tutorials. C codechamp contains a great list of C programs and tutorials.
    http:\\ccodechamp.com

    ReplyDelete
  2. For Best C Programs with Full Explanatons..
    Visit Here ►► Lightning Code

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. some c programming example i posted have a look
    http://www.computaholics.in/

    ReplyDelete
  5. thanks for ur valuable inforamtion ,u want more inforamtion about C programming languages join C programming classes in bangalore,visit : Aptech computer education,my tage are : C training bangalore,C courses bangalore,C classes bangalore,C institute bangalore,C coaching centers bangalore,C programming institute in bangalore,C programming classes in bangalore

    ReplyDelete
  6. radwap.blogspot.com see this all c pograme solution

    ReplyDelete
  7. This blog is truly useful to convey overhauled instructive undertakings over web which is truly examination. I discovered one fruitful case of this truth through this blog. I will utilize such data now.โปรแกรมขายปลีก

    ReplyDelete
  8. Write a C program to print all prime number between 1 to 300 using for loop.

    Code of given problem:

    int main()
    {
    int a,b;
    printf("List of prime numbers between 1 to 300:\n");
    printf("%d\t",a=2);
    for(a=1;a<=300;a++)
    {
    for(b=2;b<=a-1;b++)
    if(a%b==0)
    break;
    else if(b==a-1)
    {
    printf("%d\t",a);
    }
    }
    return 0;
    }

    Very informative blog!
    Please take some time to visit my blog @
    Top 10 programming examples in C

    Thanks!

    ReplyDelete
  9. write ac program to input the product number and the sales for the product and calculate the commission according to the commission rate shown below.
    product commission rate
    1 15%
    2 10%
    3 7%
    4 5%






    ReplyDelete
  10. how to add all of the commission

    ReplyDelete