Site icon TestingDocs.com

Hello World C Program

Overview

C is a popular programming language. It is reliable, simple, and easy to use. We would write the first C program in this post i.e to print Hello World.

The IDE used is Code::Blocks:

Download and Install Code::Blocks IDE:

 

C Program 

#include <stdio.h>
/*
* Program to say Hello World...
*/

int main()
{

printf("*****************n");

printf("Hello World!!n");

printf("*****************n");

return 0;

}

 

 

 

Comments are enclosed within /* */.

Program description and information can be included in the comments. It is a good practice to begin a program with a comment indicating the purpose of the program, its author and date, etc.

main() and printf() are functions in C. For example, the printf() function is used to display content on the screen. Mostly printf is to print values in variables.

The general form of printf( ) function is:
printf ( “”, ) ;


Once you have written the program you need to compile and execute it. The steps depend on the IDE and operating system you have used to write the C program. Using Code Blocks IDE on Windows you can build, compile and run the program using F9 keyboard shortcut.
Alternatively, you can use the menu options provided by the IDE to run the program.

Program Output

*****************
Hello World!!
*****************

 

 

C Tutorials

C Tutorials on this website can be found at:

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

Code::Blocks Offical website

For more information on Code Blocks IDE, visit the official website of Code blocks IDE:

http://www.codeblocks.org/

Exit mobile version