Category Archives: C++ Programs

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 »

Printing Hollow pattern in CPP

Given N = no of rows and M = no of columns, print the hollow pattern. ********** * * * * * * ********** Given above is an example of hollow pattern of 5 x 10. Given below is the approach to built hollow pattern: To iterate through rows, run an outer loop from 1 to rows. Define… Read More »

Balanced Brackets Problem in Data Structures in C++

Write a program to validate whether the brackets in the given input string are balanced or not. Examples: Input : {[()]} Output : Valid Input :{{(}}[] Output : Invalid Explanation: This problem is a very common application of stacks in data structures. An opening bracket may be ‘{‘,'[‘,'(‘ and their corresponding closing brackets are ‘}’,’]’,’)’. The brackets are… Read More »

Why choose switch case in C++

In this technological and digital age where everything is automated. We should prefer something which saves time and space and makes our work easy. Lucky for us C++ programmers, we have switch case statements. It is a great alternative to the If else condition statement. It reduces the amount of code to a very small size which saves… Read More »