Functions

C++ Templates: Program to Swap Two Numbers Using Function Template

What are Templates in C++? Templates help in defining generic classes and functions and hence allow generic programming. Generic programming is an approach where generic data types are used as parameters and the same piece of code work for various data types. Function templates are used to create family of functions with different argument types. …

C++ Templates: Program to Swap Two Numbers Using Function Template Read More »

C++ Program to Compute High Precision Division for Integers

As we know, the arithmetic operations in programming languages are limited by precision accuracy. That means you will not get an exact answer but a rounded-close answer. For example, if you have 10 divided by 3 then you will get answer like 3.33333339555496.   The following program will describe a quick and efficient method to …

C++ Program to Compute High Precision Division for Integers Read More »