You are on page 1of 2

Program To Accept Sales & Print

Average | Total Sales


SOURCE
#include<stdio.h>
#include<iostream.h>
#include<conio.h>
// Program to accept sales of each day of the month and print
the total sales and average sales
void main( )
{
clrscr( );
cout<<"-- Program to accept sales and print Total &
Average sales --\n";
const int size=3;
float sales[size],avg=0,total=0;
for (int i=0;i<size;i++)

// Loop to accept sales

{
cout<<"Enter sales made on day"<<i+1<<":";
cin>>sales[i];
total+=sales[i];
// Loop Over
} avg=total/size;
cout<<"\n Total Sales Made = "<<total<<endl;
cout<<"\n Average Sale = "<<avg<<endl;

getch( );
}
OUTPUT

You might also like