-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTask2_Time.cpp
More file actions
38 lines (28 loc) · 858 Bytes
/
Copy pathTask2_Time.cpp
File metadata and controls
38 lines (28 loc) · 858 Bytes
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
/**
* @file Task2_main.cpp
*
* @brief This code implements operator overloading.
*
* @author Saif Ullah Ijaz
*
*/
// SYSTEM INCLUDES
#include <iostream>
using namespace std;
// LOCAL INCLUDES
#include "time.h"
// function main begins program execution
void main() {
Time t1(8, 20, 10), t2(3, 40, 34);
cout << "Before Interchanging:" << endl;
cout << "Time 1: " << t1 << endl << "Time 2: " << t2 << endl << endl;
t1 = t2;
cout << "After Interchanging:" << endl;
cout << "Time 1: " << t1 << endl << "Time 2: " << t2 << endl << endl;
cout << "Pre-incrmenting Time 1 (++t1): " << ++t1 << endl;
cout << "Post-incrmenting Time 2 (t2++): " << t2++ << endl << endl;
cout << "After Incrementing:" << endl;
cout << "Time 1: " << t1 << endl << "Time 2: " << t2 << endl << endl;
system("pause");
}
// end main