BeginnersBook

  • Home
  • Java
    • Java OOPs
    • Java Collections
    • Java Examples
  • C
    • C Examples
  • C++
    • C++ Examples
  • DBMS
  • Computer Network
  • Python
    • Python Examples
  • More…
    • jQuery
    • Kotlin
    • WordPress
    • SEO
    • JSON
    • JSP
    • JSTL
    • Servlet
    • MongoDB
    • XML
    • Perl

How to install Turbo C++: Compile and Run a C Program

Last Updated: July 20, 2022 by Chaitanya Singh | Filed Under: c-programming

First thing you need to understand is that computer (Machine) can only understand Machine language (Stream of 0s and 1s). In order to convert your C program source code to Machine code, you need to compile it. Compiler is the one, which converts source code to Machine code. In simple words you can say that a compiler converts human readable code to a machine readable format.

Install Turbo C++: Step by Step Guide

Download link: Download Turbo C++ for Windows

Step 1: Locate the TC.exe file and open it. You will find it at location C:\TC\BIN\.

Step 2: File > New (as shown in above picture) and then write your C program

#include<stdio.h>
int main()
{
       printf("hello World!");
       return 0;
}

first-C-program
Step 3: Save the program using F2 (OR file > Save), remember the extension should be “.c”. In the below screenshot I have given the name as helloworld.c.
save C program
Step 4: Compile the program using Alt + F9 OR Compile > Compile (as shown in the below screenshot).
compile C program
Step 5: Press Ctrl + F9 to Run (or select Run > Run in menu bar ) the  C program.
run C program
Step 6: Alt+F5 to view the output of the program at the output screen.
output

Compile and Run C program using gcc compiler

We have seen the steps to compile and execute a C program using Turbo C++. We can also do the same using gcc compiler. The steps are as follows:

Source code Helloworld.c (file should always be saved with .c extension)

# include<stdio.h>
int main()
{
         puts ("hello World");
         return 0;
}

Compile it (it is basically converting a helloworld.c file to a helloworld file)

>gcc  helloworld.c  –o  helloworld
>

The generated file would be helloworld.exe if you are compiling on windows.

Run the compiled program
Once you give the above command, a .exe file would have been created if you are on windows then type the following command to run the source code.

For Windows

>helloworld

For Mac and Linux OS

>./helloworld

gcc compiler took the human readable format (helloworld.c file) and converted into a machine code for Windows, Linux and Mac OS X.

❮ Features of CFirst C Program ❯

Top Related Articles:

  1. C – switch case statement in C Programming with example
  2. Pointers in C Programming with examples
  3. C – for loop in C programming with example
  4. C Keywords – Reserved Words
  5. History of C Language

About the Author

I have 15 years of experience in the IT industry, working with renowned multinational corporations. Additionally, I have dedicated over a decade to teaching, allowing me to refine my skills in delivering information in a simple and easily understandable manner.

– Chaitanya

Comments

  1. Nadeera says

    January 14, 2015 at 10:03 AM

    Hi,
    This is very simple tutorial that anyone can get basic idea related to “turbo c”. So thank you very much for your valuable service.

    Reply
  2. s.sanil gupta says

    March 26, 2015 at 6:50 AM

    Thank you very much for posting these things.The beginners get a good idea about turbo compiler.

    Reply
  3. vishal singh says

    August 24, 2015 at 12:02 PM

    I WANT TO KNEW HOW TO CONVERT C++ FILE INTO EXE.

    Reply
  4. vijay kumar says

    February 22, 2016 at 10:18 AM

    how to convert c program into a setup so that it can be run on
    any computer

    Reply
  5. Social Ahmed says

    December 19, 2016 at 6:11 AM

    I would like to thank. I am pleased to know all that things, which we want about c programming. It’s a very helpful and useful to us

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

C Programming Tutorial

  • C Tutorial
  • History of C
  • Features of C
  • Turbo C++ installation
  • First C Program
  • printf scanf
  • Variables in C
  • Data Types in C
  • C - Keywords
  • C Identifiers
  • C Comments
  • Operator precedence
  • C - if statement
  • C - if..else
  • C - for loop
  • C - while loop
  • C - do while loop
  • C - continue
  • C - break statement
  • C - switch..case
  • C - goto statement
  • C - Arrays
  • 2 D array
  • C - String
  • C - functions
  • Function call by reference
  • Function call by value
  • Array to function
  • C - Structures
  • C - Pointers
  • Pointer to Pointer
  • Pointers to functions
  • C - function pointers
  • Pointer & Array
  • C - File I/O
  • C Programming Examples

Copyright © 2012 – 2025 BeginnersBook . Privacy Policy . Sitemap