Assignment#3
Assignment#3
// overload_op():num(0){}
// void input(){
// cout << "Enter a number: "<< endl;
// cin >> num;
// }
// void display_sum(){
// cout << "Addition = " << num << endl;
// }
// void display_sub(){
// cout << "Subtraction = " << num << endl;
// }
// void display_mul(){
// cout << "Multiplication = " << num << endl;
// }
// void display_div(){
// cout << "Division = " << num << endl;
// }
// void display_mod(){
// cout << "Modulus = " << num << endl;
// }
// };
// int main(){
// overload_op obj1,obj2,obj3;
// obj1.input();
// obj2.input();
// obj3 = obj1 + obj2;
// obj3.display_sum();
// obj1.input();
// obj2.input();
// obj3 = obj1 - obj2;
// obj3.display_sub();
// obj1.input();
// obj2.input();
// obj3 = obj1 * obj2;
// obj3.display_mul();
// obj1.input();
// obj2.input();
// obj3 = obj1 / obj2;
// obj3.display_div();
// obj1.input();
// obj2.input();
// obj3 = obj1 % obj2;
// obj3.display_mod();
// }
// #include<iostream>
// using namespace std;
// class overloading_op{
// public:
// int num;
// overloading_op():num(0){}
// void input(){
// cout << "Enter a number: "<< endl;
// cin >> num;
// }
// void display_incr_prefix(){
// cout << "Increment prefix = " << num << endl;
// }
// void display_decr_postfix(){
// cout << "Decrement postfix = " << num << endl;
// }
// void display_decr_prefix(){
// cout << "Decrement prefix = " << num << endl;
// }
// void display_not(){
// cout << "Not opertor value = " << num << endl;
// }
// };
// int main(){
// overloading_op obj;
// obj.input();
// obj++;
// obj.display_incr_postfix();
// obj.input();
// ++obj;
// obj.display_incr_prefix();
// obj.input();
// obj--;
// obj.display_decr_postfix();
// obj.input();
// --obj;
// obj.display_decr_prefix();
// obj.input();
// !obj;
// obj.display_not();
// }
// #include<iostream>
// using namespace std;
// class overloading_op{
// public:
// int num;
// overloading_op():num(0){}
// void input(){
// cout << "Enter a number: "<< endl;
// cin >> num;
// }
// }
// }
// }
// }
// }
// }
// };
// int main(){
// overloading_op object1,object2;
// object1.input();
// object2.input();
// if(object1 == object2){
// cout << "Equal " << endl;
// }
// else{
// cout << "Unequal "<< endl;
// }
// object1.input();
// object2.input();
// if(object1 > object2){
// cout << "object1 is greater "<< endl;
// }
// else{
// cout << "object2 is greater "<< endl;
// }
// object1.input();
// object2.input();
// if(object1 < object2){
// cout << "object1 is lesser "<< endl;
// }
// else{
// cout << "object2 is lesser "<< endl;
// }
// object1.input();
// object2.input();
// if(object1 <= object2){
// cout << "object1 is less or equal to object2 " << endl;
// }
// else{
// cout << "object2 is less or equal to object1 "<< endl;
// }
// object1.input();
// object2.input();
// if(object1 >= object2){
// cout << "object1 is greater or equal to object2 " << endl;
// }
// else{
// cout << "object2 is greater or equal to object1 "<< endl;
// }
// object1.input();
// object2.input();
// if(object1 != object2){
// cout << "object1 not equal to object2 " << endl;
// }
// else{
// cout << "object1 equal to object2 "<< endl;
// }
// }
// #include<iostream>
// using namespace std;
// class overloading_op{
// public:
// int num;
// overloading_op():num(0){}
// void input(){
// cout << "Enter a number: "<< endl;
// cin >> num;
// }
// }
// }
// };
// int main(){
// overloading_op val1,val2,val3;
// val1.input();
// val2.input();
// val3.input();
// if (val1 > val2 && val2 == val3 || val1 > val3 && val3 > val2){
// cout << "condition true "<< endl;
// }
// else{
// cout << "condititon false "<< endl;
// }
// }
// #include<iostream>
// using namespace std;
// class overloading_op{
// public:
// int num;
// overloading_op():num(0){}
// void input(){
// cout << "Enter a number: "<< endl;
// cin >> num;
// }
// int main(){
// overloading_op value1,value2;
// value1 = 50;
// cout << "value = "<< value1.num << endl;
// value1 += 21;
// cout << "value += "<< value1.num << endl;
// value1 -=21;
// cout << "value -= "<< value1.num << endl;
// value1 *= 21;
// cout << "value *= "<< value1.num << endl;
// value1 /= 2;
// cout << "value /= "<< value1.num << endl;
// value1 %= 2;
// cout << "value %= "<< value1.num << endl;
// }