Hello World Program in C | Basic C Language Example


Our Blogs

Hello-World.webp

Hello World program in C language

C Language

Publish Date: April, 25-2019

The "Hello World" Program in C

The intent of your code snippet:

C

#include #include void main() { printf("Hello World !"); }

Standard C Code

For a modern C compiler, the most accurate and standardized way to write this program is:

C

#include <stdio.h>

int main() {
    printf("Hello World !");
    return 0; // Indicates successful execution
}

Code Explanation

  1. #include <stdio.h>

    • This line is a preprocessor directive. It tells the compiler to include the contents of the standard input/output library (stdio.h).

    • This library contains the definition for the printf() function, which is necessary to display output on the console.

  2. int main() { ... }

    • This is the main function where the program execution begins.

    • int indicates that the function will return an integer value.

    • The use of void main() is often accepted by older compilers but is non-standard in modern C.

  3. printf("Hello World !");

    • This is the core command. The printf function prints the text string enclosed in the double quotes (" ") to the console (or standard output).

    • The semicolon (;) marks the end of the statement.

  4. return 0;

    • This is a standard practice within the int main() function.

    • It tells the operating system that the program has executed successfully.

Output:

Hello World !

Recent Post :-

engineers-day_11zon.webp

Happy Engineers Day 2026 Wishes from Paramwebinfo Team

Festival Post

Publish Date: September, 15-2026

Website-Speed-Guide_11zon.webp

How to Improve Website Speed with Better Web Hosting with Paramwebinfo

Web Hosting Tips

Publish Date: September, 14-2026

Ganesh-Chaturthi-Wishes_11zon.webp

Happy Ganesh Chaturthi 2026 Wishes from Paramwebinfo

Festival Post

Publish Date: September, 14-2026

customer-meta-ads_11zon.webp

How Meta Ads Can Grow Your Business Online With Paramwebinfo

Grow your business

Publish Date: September, 12-2026

AEO-vs-GEO_11zon.webp

AEO vs GEO How to Make Your Business Visible in AI Search Results

Digital Marketing

Publish Date: September, 10-2026

Video-Editing-Services_11zon.webp

Video Editing and Reels Making Services in Raipur by Paramwebinfo

Digital Marketing

Publish Date: September, 07-2026

Teachers-Day-poster.webp

Happy Teachers Day Wishes from Paramwebinfo

Festival Post

Publish Date: September, 05-2026

Krishna-Janmashtami-Poster_11zon.webp

Happy Krishna Janmashtami from Paramwebinfo Team

Festival Post

Publish Date: September, 04-2026