-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathWeek 16 Q2.cpp
48 lines (43 loc) · 892 Bytes
/
Week 16 Q2.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
44
45
46
47
48
#include<iostream>
using namespace std;
class String
{
public:
int day;
int month;
int year;
public:
Displaydate(int day = 1, int month = 1, int year = 2016); // Normal Constructor
//Displaydate(const Displaydate &t); // Copy Constructor
};
/*Displaydate::Displaydate(int i, int j, int k){
day=i;
month=j;
year=k;
}*/
void displaydate(int day, int month, int year)
{
cout<<"Date is "<<day<<"-"<<month<<"-"<<year<<endl;
}
void displaydatedifference(char **date1, char **date2)
{
int date1=(**date1[0]*10)+(**date1[1]);
int date2=(**date2[0]*10)+(**date2[1]);
cout<<"Date Difference is "<< (date1-date2) <<endl;
}
int main(){
/*int x,y,z;
cout<<"Day?";
cin>>x;
cout<<"Month?";
cin>>y;
cout<<"Year?";
cin>>z;
displaydate(x,y,z);
*/
cout<<"Date1?";
cin>>x;
cout<<"Date2?";
cin>>y;
displaydatediffrence(x,y);
}