Category Archives: Programs

Pythagorean Triplet in an array using STL

Given an array of integers, write a function that returns true if there is a triplet (a, b, c) that satisfies a2+b2=c2 Example: Input: arr[] = {8, 1, 4, 6, 10} Output: True There is a Pythagorean triplet (8, 6, 10). Input: arr[] = {1, 2, 4, 3} Output: False There is no Pythagorean triplet. Approach: The problem… Read More »

Writing First C++ Program – Hello World Example

C++ is Object-Oriented Programming (OOP) language. C++ is easy to understand. You can learn C++ by following these steps: Writing your program in a text editor. Then saving it with the appropriate file extension (e.g., .cpp, .c, .cp). Compiling your program using a compiler or an online Integrated Development Environment (IDE). Understanding of the basic terminologies. Writing First… Read More »

Setting up C++ Development Environment

C++ is programming language. It is object-oriented, and generic programming paradigms. C++ is compatible with multiple platforms such as Windows, Linux, Unix, and Mac. Using Online IDE Before starting C++ programming, it is necessary to set up an environment on your local computer to compile and execute C++ programs. You can also use Online Integrated Development Environments (IDEs)… Read More »