Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

Program to display salesman's sale and item wise sale

Posted By: Easy Tutor     Category: C Programming     Views: 12519

Write a program to take salesman sale for 3 items and provide item wise total.

Code for Program to display salesman's sale and item wise sale in C Programming

#include <stdio.h>
#include <conio.h>
void main(){
     int salitm[4][3],i,j,itmtot[3]={0},salpertot[4]={0};
     clrscr();
     printf("*****Sales Item Demo*****\n\n");
     printf("Enter details for 4 salesman's purchase for 3 items\n");
     //logicfor(i=0;i<4;i++){
       for(j=0;j<3;j++){
        scanf("%d",&salitm[i][j]);
        salpertot[i] = salpertot[i] + salitm[i][j];
        itmtot[j] = itmtot[j] + salitm[i][j];
       }
     }

     //display
     printf("\n\n\tItem1\tItem2\tItem3\n");
     for(i=0;i<4;i++){
     printf("%s%-4d","S",i+1);
    for(j=0;j<3;j++){
        printf("%*d",7+j,salitm[i][j]);
    }
    printf("\n");
     }

     printf("\nItem Wise total\n");
     for(j=0;j<3;j++)
    printf("%s%-3d=%5d\t","Item",j+1,itmtot[j]);

     printf("\n\nSalesman Wise total\n");
     for(j=0;j<4;j++)
    printf("%s%-3d=%5d\t","S",j+1,salpertot[j]);

     getch();
}
  
Share: 


Didn't find what you were looking for? Find more on Program to display salesman's sale and item wise sale Or get search suggestion and latest updates.

Easy Tutor
Easy Tutor author of Program to display salesman's sale and item wise sale is from United States. Easy Tutor says

Hello Friends,

I am Free Lance Tutor, who helped student in completing their homework.

I have 4 Years of hands on experience on helping student in completing their homework. I also guide them in doing their final year projects.

I have share many programs on this website for everyone to use freely, if you need further assistance, than please contact me on easytutor.2ya [at the rate] gmail [dot] com

I have special discount scheme for providing tutor services. I am providing tutor service to students from various contries, currently most of my students are from United States, India, Australia, Pakistan, Germany, UK and Canada.

I am also here to expand my technical network to receive more opportunity in my career, make friends to help them in resolving their technical problem, learn and share my knowledge, If you like to be my friend, Please send me friend request.

Thanks,
Happy Programming :)

 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!