You are requested by a store opens the entire week) Store comprises of two sections namely the Your in Soshanguve to calculate it SuperStore (Spar) and determine the day with the highest Food section C++ program anagement for the should prompt the total sales for each section for each day [27 ] ’ s earning for the week and lowest earning s (the . The a nd the Liquor store . and store the total sales for the day into an array. At the end of the week It should display a report for M total highest sales were sales for that week, t recorded.
#include <bits/stdc++.h>
using namespace std;
int largest(int arr[], int n)
{
int i;
int max = arr[0];
for (i = 1; i < n; i++)
if (arr[i] > max)
max = arr[i];
return i;
}
int main()
{
int arr[5]; //suppose there are 5 items in store
cout<<"Enter the sales of 5 items:";
for(int i=;i<5;i++)
{ cin>>arr[i];}
cout << "Largest sales is for item"<< largest(arr, n) + 1;
return 0;
}
Comments
Leave a comment