A Developer Gateway To IT World...

Techie Uncle Software Testing Core Java Java Spring C Programming Operating System HTML 5 Java 8 ES6 Project

to read price of items in array and then display sum of all the prices, product of all the prices and average of them.

#include<iostream>
using namespace std;
int main()
{
int i;
double price[5], sum=0, avr=0, prod=1;
for(i=0;i<5;i++)
{
cout<<"enter the price of items"<<i <<"\n";
cin>>price[i];
sum=price[i];
prod=price[i];
}
avr=sum/5;

cout<<sum<<endl;
cout<<prod<<endl;
cout<<avr<<endl;

}

LEARN TUTORIALS

.

.