C++ ProgramLast Updated : 17 Mar 2025 Before starting the abcd of C++ language, you need to learn how to write, compile and run the first C++ program. To write the first C++ program, open the C++ console and write the following code: #include<iostream.h> includes the standard input output library functions. It provides cin and cout methods for reading from input and writing to output respectively. #include <conio.h> includes the console input output library functions. The getch() function is defined in conio.h file. void main() The main() function is the entry point of every program in C++ language. The void keyword specifies that it returns no value. cout << "Welcome to C++ Programming." is used to print the data "Welcome to C++ Programming." on the console. getch() The getch() function asks for a single character. Until you press any key, it blocks the screen. ![]() How to compile and run the C++ programThere are 2 ways to compile and run the C++ program, by menu and by shortcut. By menuNow click on the compile menu then compile sub menu to compile the c++ program. Then click on the run menu then run sub menu to run the c++ program. By shortcutOr, press ctrl+f9 keys compile and run the program directly. You will see the following output on user screen. ![]() You can view the user screen any time by pressing the alt+f5 keys. Now press Esc to return to the turbo c++ console. Next TopicC++ cout, cin, endl |
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India

