HI,
im quite new to c++ programming i have made this simple programme which adds sales figures entered togther to give you a total.
But it seems very long and i was woundering how to i cut it down and also next i would like them to be able to be sorted in order of highest to lowest??? any ideas how i go about this???
Heres the code so far: ........Thanks
[code] #include <stdio.h>
#include <conio.h>
/* This C program produces a */
void main(void)
{
clrscr();
int a, b, c, d, e, f, g, h;
clrscr();
printf("Sales figures For Westwing\n");
printf("Enter the first branch sales figures :","i");
scanf("%d", &a);
printf("Enter the second branch sales figures:");
scanf("%d", &b);
printf("Enter the third branch sales figures:");
scanf("%d", &c);
printf("Enter the forth branch sales figures:");
scanf("%d", &d);
printf("Enter the fith branch sales figures:") ;
scanf("%d", &e);
printf("Enter the sixth branch sales figures:");
scanf("%d", &f);
printf("Enter the seventh branch sales figures:");
scanf("%d", &g);
printf("Enter the eighth branch sales figures:");
scanf("%d", &h);
h = a + b + c + d + e + f + g;
printf("The total amount made for all 8 branches is = %d\n",h);
getchar();
getchar(); [/cpde]