Skip to content
  • Linkedin
  • Youtube
  • Pinterest
  • Home
  • Privacy Policy
  • About
  • Contact
Programmingoneonone

Programmingoneonone

Programmingoneonone is a website that publishes daily tutorials, methods, guides, and articles on IT, Education, and technology.

  • Home
  • Human Values
  • DSA
  • IoT Tutorials
  • Interview Questions and Answers
  • Toggle search form

Compiling C Programs

Posted on 4 September 202220 May 2023 By YASH PAL No Comments on Compiling C Programs

In this post, we are going to learn about compiling c programs and generating output. so once you have written the program you need to type it and instruct the machine to execute it. To type your C program you need another program called Editor.

Once the program has been typed it needs to be converted to machine language ( Os and Is ) before the machine can execute it To carry out this conversion we need another program called Compiler Compiler Vendors to provide an Integrated Development Environment ( IDE ) which consists of an Editor as well as the Compiler.

There are several such IDEs available in the market targeted toward different operating systems. For example, Turbo C, Turbo C ++, and Microsoft C are some of the popular compilers that work under MS-DOS, Visual C ++ and Borland C ++ are the compilers that work under Windows, whereas GCC compiler works under Linux. Note that Turbo C++, Microsoft C++, and Borland C ++ software also contain a C compiler bundled with them.

If you are a beginner you would be better off using a simple compiler like Turbo C or Turbo C ++ Once you have mastered the language elements you can then switch over to more sophisticated compilers like Visual C++ under Windows or GCC under Linux. here are the steps that you need to follow to compile and execute your first C program.

  1. Start the compiler at C prompt The compiler ( TC EXE IS usually present in C: \ TC \ BIN directory ).
  2. Select New from the File menu.
  3. Type the program.
  4. Save the program using F2 under a proper name ( say Program1.c ).
  5. Use Ctrl + F9 to compile and execute the program.
  6. Use Alt + F5 to view the output.

Note that on compiling the program its machine language equivalent is stored as an EXE file ( Programl.EXE ) on the disk This file is called an executable file If we copy this file to another machine we can execute it there without being required to recompile it, In fact, the other machine need not even have a compiler to be able to execute the file.

A word of caution! If you run this program in the Turbo C++ compiler, you may get an error ” The function printf should have a prototype”. To get rid of this error, perform the following steps and then recompile the program.

Select the ’Options’ menu and then select ‘Compiler | C ++’ Options In the dialog box that pops up, select ” CPP always” in the Use C ++ Compiler ‘ options.

Again select the Options menu and then select Environment | Editor Make sure that the default extension is C rather than ‘CPP’.

Read other tutorials

Reading input in c programming

C Programming Tutorials, Computer Science Tutorials Tags:c, computer science

Post navigation

Previous Post: The First C Program
Next Post: Reading Input in a C program

Related Tutorials

Reading input in c programming Reading Input in a C program C Programming Tutorials
The First C Program C Programming Tutorials
History of c programming language HISTORY OF C Programming Language C Programming Tutorials
c character sets C Character Sets C Programming Tutorials
c programming interview questions and answers C Programming Interview Questions and Answers C Programming Tutorials
basic structure of c program Basic Structure of C Program C Programming Tutorials

Leave a Reply Cancel reply

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

Pick your Subject

  • Internet of Things
  • Data Structures/Algorithms
  • Interview Preparation
  • Human Values
  • Java Interview Questions and Answers (2023)
    Thinking of becoming a Java developer? I must say it’s a good choice! Java is continuously named the most popular programming language. And the...

    Learn More “Java Interview Questions and Answers (2023)” »

  • Iot(Internet of things) in healthcare
    IoT in Healthcare
    IoMT (Internet of Medical Things) stands for devices that can collect and exchange data – either with users or other devices via the internet,...

    Learn More “IoT in Healthcare” »

  • four stages of iot solution for industry
    IoT for Industry
    In this post, we are going to learn about use cases of IoT for Industry and four stages for providing IoT solutions. Machine Diagnosis...

    Learn More “IoT for Industry” »

  • Iot for agricultural
    IoT in Agriculture
    IoT technology has realized smart wearables, connected devices, automated machines, and driverless cars. However, in agriculture, the IoT has brought the greatest impact. Amongst the challenges...

    Learn More “IoT in Agriculture” »

  • Iot for logistics
    IoT in Logistics and Supply Chain
    IoT applications for smart logistics and supply chain systems:  Logistics Fleet Tracking  To track the locations of the vehicles in real time, the vehicle...

    Learn More “IoT in Logistics and Supply Chain” »

  • Algorithms Tutorials
  • Basic Programming
  • C Programming Tutorials
  • C++ Tutorials
  • Compiler Design Tutorials
  • Computer Networks Tutorials
  • Computer Organization Tutorials
  • Computer Science Tutorials
  • Data Structures Tutorials
  • DBMS Tutorials
  • Developer Guide
  • Digital Communication
  • Digital Logic Tutorials
  • Internet of Things Tutorials
  • Internet Tutorials
  • Interview questions answers
  • Java Tutorials
  • Javascript Tutorials
  • Machine Learning Tutorials
  • Operating Systems Tutorials
  • Programming Tutorials
  • Projects
  • Tips&Tricks
  • Tools
  • VBScript Tutorials
  • Java Interview Questions and Answers (2023)
    Thinking of becoming a Java developer? I must say it’s a good choice! Java is continuously named the most popular programming language. And the...

    Learn More “Java Interview Questions and Answers (2023)” »

  • Iot(Internet of things) in healthcare
    IoT in Healthcare
    IoMT (Internet of Medical Things) stands for devices that can collect and exchange data – either with users or other devices via the internet,...

    Learn More “IoT in Healthcare” »

  • four stages of iot solution for industry
    IoT for Industry
    In this post, we are going to learn about use cases of IoT for Industry and four stages for providing IoT solutions. Machine Diagnosis...

    Learn More “IoT for Industry” »

  • Iot for agricultural
    IoT in Agriculture
    IoT technology has realized smart wearables, connected devices, automated machines, and driverless cars. However, in agriculture, the IoT has brought the greatest impact. Amongst the challenges...

    Learn More “IoT in Agriculture” »

  • Iot for logistics
    IoT in Logistics and Supply Chain
    IoT applications for smart logistics and supply chain systems:  Logistics Fleet Tracking  To track the locations of the vehicles in real time, the vehicle...

    Learn More “IoT in Logistics and Supply Chain” »

Copyright © 2023 Programmingoneonone.

Powered by PressBook Blog WordPress theme