-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexp.cpp
43 lines (34 loc) · 956 Bytes
/
exp.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <iostream>
using namespace std;
// Sharif Ullah Danish
void disarr(int Per, int m,int expenses[][6]);
int main()
{
const int PER=3;
const int MONTH=6;
int Expenses[PER][MONTH];
disarr(PER,MONTH,Expenses);
return 0;
}
void disarr(int per,int m,int expenses[][6])
{
for(int i=0; i<per; i++)
{
int total=0, max, min=999999;
cout<<" User "<<i+1<<" Data: "<<endl;
cout<<"__________________________________________"<<endl;
for(int j=0; j<m; j++)
{
cout<<"Enter expenses for month month "<<j+1<<": ";
cin>>expenses[i][j];
total+=expenses[i][j];
if(expenses[i][j]>max) max = expenses[i][j];
if(expenses[i][j]<min) min = expenses[i][j];
}
cout<<"*******************************************"<<endl;
cout<<"\t Total: "<<total<<endl;
cout<<"\t Max: "<<max<<endl;
cout<<"\t Min: "<<min<<endl;
cout<<"*******************************************"<<endl;
}
}