How to install C++

There is a wide range of free and payable C++ compilers available on the World Wide Web such as Apple C++, Borland C++, IBM C++, Sun Studio and Turbo C++. In this tutorial, we are providing guidance on how to install Turbo C++


 


  • Download TURBO C++ from the internet, it is freely available software.
  • The second step is turboc directory creation inside your computer c drive
  • The third step is tc3.zip extraction, which is located inside c:\turboc
  • After extraction, double-click on the exe file
  • You need to click on TC, which is application file located inside c:\TC\BIN to start writing code.

C++ Basic Program

Open C++ console, write the basic code in it.

#include <iostream.h>  

#include <conio.h>  

Void main() {  

  clrscr();  

  cout << "This is your first c++ program";   

  getch();  

}

Where , #include <iostream.h> are the header files that are known as standard input-output library functions and console input output library functions respectively and mainly used for providing basic required functions such as cin, cout and getch function.

int main() /void main() the main function, is the core of every c++ program act as an entry point. int is used to return an integer value to indicate the program successfully executed whereas void keyword does not return any value.

getch() This function permits the users to see the output and wait for the user to press a key.

After writing a  program, you need to compile and execute it. Go to compile menu and click on compile and then click on run submenu to execute your first c++ program.

You can also directly execute your program by simply pressing ctrl +f9 keys.

Leave a Reply

avatar
  Subscribe  
Notify of