First C Program (Hello World)
First C Program in C (Hello World)
Introduction to First C Program
The first step in learning C programming is writing a simple program. The most common beginner program is the Hello World program.
This program helps you understand the basic syntax and structure of C programming.
Hello World Program in C
#include <stdio.h>
int main() {
printf(“Hello, World!”);
return 0;
}
Explanation of Hello World Program
Header File
#include <stdio.h> is used to include the standard input-output library.
Main Function
int main() is the starting point of the program where execution begins.
printf Function
printf() is used to display output on the screen. Here it prints “Hello, World!”.
Return Statement
return 0; ends the program and returns control to the operating system.
How to Run a C Program
Step 1: Write Code
Write the program in any code editor and save it with .c extension.
Step 2: Compile the Program
Use a compiler like GCC to compile the code.
Step 3: Run the Program
After compilation, run the program to see the output.
Why First Program is Important
The Hello World program is important because it introduces you to the basic structure of C programming. It builds confidence and helps you understand how code works.
Start Learning C Programming
Practicing simple programs like Hello World helps you build a strong base in C programming.
Summary
The first C program, Hello World, is the starting point for every beginner. It helps you understand syntax, structure, and how output works in C programming.
FAQs
What is Hello World program in C?
It is the first program beginners write to display a simple message on the screen.
Why is Hello World important?
It helps beginners understand the basic syntax and structure of C programming.
What does printf do in C?
The printf function prints output to the screen.
How do I run a C program?
Write the code, compile it using a compiler, and then execute the program.



