Pre-increment and Post-increment Program in C++

This C++ program overloads the pre-increment and post-increment operators for user-defined objects. The pre-increment operator is an operation where the value attribute of the object is incremented and the reference to resulting object returned whereas in the post-increment operator, a local copy of the object is saved, the value attribute of the object is incremented … Read more

advertisement

Overload Unary Minus Operator in C++

This C++ program overloads the minus(-) operator. The program defines a class and instantiates it. The minus operator is defined inside the class. The value of two objects can be subtracted using this operator. Here is the source code of the C++ program which overloads the minus(-) operator. The C++ program is successfully compiled and … Read more

advertisement

Operator Overloading Program in C++

This C++ program overloads the == operator in the Circle Class. The Circle is a user-defined class with radius as its only data member and with provision of member function which computes the area of the circle. The overloaded == operator compares two circles on the basis of their radii, i.e. the circle would be … Read more

advertisement

C++ Program to Multiply Twp Numbers Without * Operator

This C++ program multiplies two given numbers without using multiplication operator. The multiplication is achieved by use of a for loop which keeps adding first number to variable product in each iteration till the value of second number drops to 0. Here is the source code of the C++ program multiplies two given numbers without … Read more

advertisement

C++ Comparison Operators

This C++ Program demonstrates the use of comparison operators. Here two numbers are given as input and the result of operation is output on the screen. Here is source code of the C++ program which demonstrates the use of comparison operators. The C++ program is successfully compiled and run on a Linux system. The program … Read more

advertisement

C++ Arithmetic Operators

This C++ Program demonstrates the use of arithmetic operators. Here numbers are given as input and the result of operation is output on the screen. Here is source code of the C++ program which demonstrates the use of arithmetic operators. The C++ program is successfully compiled and run on a Linux system. The program output … Read more

advertisement

Assignment Operator Overloading in C++

This C++ program demonstrates overloading of assignment (=) operator. The program defines a class, defines the assignment operator for the class, creates an instance of the class and demonstrates its use. Here is the source code of the C++ program which demonstrates overloading of assignment (=) operator. The C++ program is successfully compiled and run … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.