C++ programs helps you to learn C++ programming practically.
Nov 28, 2015 You need to understand that the header file code c /code was created to facilitate calls to System API and the OS, so that programmers could use system calls such as code cdelay (int)/code or code csleep (int) /code in t.
So here, we have listed more than 100 C++ programs along with their output from simplest C++ program to shutdown your computer using C++ program.
Here, we have included two functions namely clrscr() and getch() (mainly for Turbo C++ users) in approximately every C++ program.
The function clrscr() (of conio.h library) is used to clear (clean or format) the output screen to watch the program's output only. And the function getch() (of conio.h library) is used to hold the output screen (at last of the program or when the program finished) until a key is pressed. After pressing the key, your output screen will be closed and you will be backed to the source code.
Let's start from simplest C++ program, given here in the following example.
Following is the simplest C++ program which will print the string 'Hello Compiler, I am C++' on the output screen as shown here: Include iostream h dev c++.
When the above C++ program is compile and executed, it will produce the following output:
Here is another C++ program example.
When you compile and run the above C++ program, you will get the following output after the sample run:
Here is the sample run of the above C++ program. Here is the first run:
This is the second run:
Here is the sample run of the above C++ program. Below is the first run:
Now, here is the second run:
Here is the sample run of the above C++ program. Following is the first run:
Now is the second run:
You may also like to go through all these programs list in other languages such as: