TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

C Tutorials

Compile and Execute C Program

Overview

This tutorial will teach the steps to compile & execute C Program on Windows operating system.

Setup Environment

Setup C programming environment. Install C compiler and text editor like Notepad++.

Setup Programming Environment

Create Source Code File

Open a text editor and add the C code.

Save the file with the *.c file extension. For example,  ‘helloworld.c’  file.

Create C Program Text Editor Win10

C Code

/**
**********************************
* Program Description:
* C Hello World Program
* Filename : helloworld.c
* Author : TestingDocs
* Date : 02/03/2017
* C Tutorials – www.TestingDocs.com
*************************************
*/
#include<stdio.h>
int main()
{
/* C Hello World Program
using Text Editor and command line
On Windows 10 operating system.
*/
printf(“Hello, World! \n”); // print message

return 0;
} // end main

 

Compile C Program

Open a command prompt and issue the following command to compile the code:

\> gcc <filename.c>

\> gcc helloworld.c

 

Compile C Program on Windows

Execute C Program

If there are no errors in the code, an executable file will be generated ( a.exe )

Type the following command to execute the C program.

\> a.exe

That’s it. We have successfully complied and executed a sample C program on Windows operating system using the command line prompt.

—

C Tutorials

C Tutorials on this website can be found at:

https://www.testingdocs.com/c-language-tutorial/

Related Posts

C Language Characteristics

C Tutorials /

C Language Characteristics

C Source Code .c File

C Tutorials /

C Program Files & Formats

GNU Compiler Collection GCC

C Tutorials /

C Compilers

C Pointers

C Tutorials /

C Pointers

C Tutorials /

C Two-Dimensional Arrays

‹ C Variable Initialization› C Comments

Recent Posts

  • MS Access Data Types
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version