Skip to content
Programmingoneonone
Programmingoneonone
  • Engineering Subjects
    • Internet of Things (IoT)
    • Digital Communication
    • Human Values
  • Programming Tutorials
    • C Programming
    • Data structures and Algorithms
    • 100+ Java Programs
    • 100+ C Programs
    • 100+ C++ Programs
  • Solutions
    • HackerRank
      • Algorithms Solutions
      • C solutions
      • C++ solutions
      • Java solutions
      • Python solutions
    • Leetcode Solutions
    • HackerEarth Solutions
  • Work with US
Programmingoneonone
Programmingoneonone

Compiling C Programs

YASH PAL, 4 September 202219 February 2026

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 Computer Science Tutorials cC Programcomputer science

Post navigation

Previous post
Next post

Leave a Reply

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

The First C Program
Reading Input in a C Program
Compiling C Programs
C Program to read a number and print the factorial
C Program to Print the Sum of N Natural Numbers
C Program to Print Factorial of any Given Number
C Program to Check a Prime Number or Not
C Program to Print the Power of a Given Number
C Program to Print Factors of a Given Number
C Program to Print Factorial using Recursion
C Program to find gross salary
C Program to Reverse a Given Number
C Program to Swap Two Numbers without Using a Third Variable
C Program to Calculate the sum of subjects and find the percentage
C Program to convert temperature from centigrade to Fahrenheit
C Program to find simple interest
C Program to find the area and circumference of a circle
C Program to find the sum of two numbers
C Program to find the sum of two matrices
C Program to find even/odd numbers
C Program to display a matrix
C Program to show the use of the conditional operator
C Program to find the maximum number in an array
C Program to find the greatest of 3 Numbers
C Program to show the sum and average of 10 elements of an array
C Program to print a table of any number
C Program to add two numbers using pointers
C Program to use the bitwise AND operator between the two integers
C Program to display an odd number series and find the sum
C Program to display the sum of the harmonic series
C Program to print the Fibonacci series up to 100
C Program to print a star pattern in a pyramid shape
C Program to print a star pattern in a reverse triangle shape
C Program to print a star pattern in a triangle shape
C Program to display the first 10 natural numbers and their sum
C Program to display arithmetic operations using a switch case
C Program to display weekdays using a switch statement
C Program to find the subtraction of two matrices
C Program to shift input data by two bits to the left
C Program to find occurrences of vowels, consonants, words, spaces and special characters in give sentence
C Program to merge two arrays, excluding the repeating elements
C Program to perform file operations
C Program to find a palindrome number
C Program to find the largest of two numbers using the function
C Program to show call by reference
C Program to show call by value
C Program to show a table of numbers using a function
C Program to find the factorial of a number using a function
C Program to swap two numbers using a function
C Program to find the square of a number using a function
C Program to show input and output of a string
C Program to print the powers of 2 tables for the powers 0 to 20
C Program to find the maximum number in an array using a pointer
C Program to print the multiplication table
C Program to find the transpose of a matrix
C Program to evaluate the equation y=xn
C Program to find the multiplication of two matrices
C Program to display months using enum
C Program for finding the largest number in an array
C Program for sorting the elements of an array in descending order
C Program to count the number of students in each group
C Program to evaluate a square expression and its sum
C Program for plotting of two functions
C Program of minimum cost problem
C Program to draw a histogram
C Program to print a binomial coefficient table
C Program to read a line of text
C Program to illustrate the use of the continue statement
C Program to read a string using the scanf() function
C Program to evaluate the geometric progression series
C Program for production and sales analysis
C Program to illustrate the use of the break statement
C Program to evaluate response to a multiple-choice test
C Program to print the total marks obtained by a student
C Program to calculate standard deviation
C Program to sort a list of numbers and to determine the median
C Program for finding the desired kth smallest element in an array
C Program for removing duplicate elements in an array
C Program to use functions with no arguments and no return values
C Program to sort a customer list in the alphabetical list
C Program for counting characters, words, and lines in a text
C Program to sort a list of names in alphabetical order
C Program to calculate the square and cube by using a function as an argument
C Program to use string handling functions
C Program to return only absolute values
C Program to concatenate a string
C Program to pass arguments to a user-defined function by value/reference
C Program to print the Character and Decimal value of alphabet
C Program to return more than one value from a user-defined function
C Program to count the number of characters copied into a string
C Program to show the use of user defined function
C Program to use global variables on different functions
C Program to use similar variables in different functions
C Program to define & call user-defined functions
C Program to call a user-defined function
C Program to find the power of a value using a function
C Program to use functions with arguments and return values
C Program to use functions with arguments but no return values
C Program to use the ++ operator with the return value of a function
C Program to perform multiplication and division of numbers
C Program to perform addition and subtraction of numbers
C Program to assign the return value of a function to another variable
C Program to call the function through a for loop
C Program to call the user-defined function through the switch() statement
C Program to call the user-defined function through an if statement
C Program to evaluate the function equation s = sqr(a() + b())
C Program to use modulo % with a function
Student marksheet program in C programming

Programmingoneonone

We at Programmingoneonone, also known as Programming101 is a learning hub of programming and other related stuff. We provide free learning tutorials/articles related to programming and other technical stuff to people who are eager to learn about it.

Pages

  • About US
  • Contact US
  • Privacy Policy

Practice

  • Java
  • C++
  • C

Follow US

  • YouTube
  • LinkedIn
  • Facebook
  • Pinterest
  • Instagram
©2026 Programmingoneonone | WordPress Theme by SuperbThemes