To create a simple C program which prints "Hello, World" on the screen, use a text editor or Visual studio to create a new file (e.g. hello.c — the file extension must be .c) containing the following source code:
// Hello World Program C language //
/* This line tells the compiler to include the
contents of the standard library header file stdio.h
in the program.Headers are usually files containing
function declarations, macros and data types, and you
must include the header file before you use them.
This line includes stdio.h so it can call the
function puts(). */
#include <stdio.h>
/* This line starts the definition of a function.
It states the name of the function (main), the type
and number of arguments it expects (void, meaning
none), and the type of value that this function
returns (int). Program execution starts in the main()
function. */
int main(void)
{
puts("Hello, World");
// or //
printf("Hello, world");
return 0;
}
/*
Output Of a Program :
Hello, World
Hello, world
*/