Tuesday, 28 July 2026

Your First C Program .

💻 Your First C Program

Hello World Program Explained Step by Step

Start Your Programming Journey With C Language 🚀


🚀 Introduction to C Programming

In the previous lessons, we learned about programming, algorithms, and flowcharts.

Now it is time to write our first real computer program using C Programming Language.

C is one of the most important programming languages and is known as the foundation of modern programming.

"Every programmer starts with a simple Hello World program."


⭐ Why Learn C Programming?

  • Easy to understand programming logic
  • Foundation for C++, Java and other languages
  • Used in operating systems
  • Used in embedded systems
  • Improves problem-solving skills

⌨️ Our First C Program

The famous first program prints:

Hello, World!

C Code:


#include <stdio.h>

int main()
{
    printf("Hello, World!");

    return 0;
}


🔍 Understanding Each Line

📌 #include <stdio.h>

This includes the standard input-output library. It allows us to use printf().

📌 int main()

The main function is where program execution starts.

📌 printf()

Used to display output on the screen.

📌 return 0;

Indicates that the program finished successfully.


🔄 How This Program Works

C Source Code
⬇️
Compiler
⬇️
Machine Code
⬇️
Computer Executes Program
⬇️
Output: Hello, World!

🛠️ How to Run a C Program

  1. Install a C compiler
  2. Write your C code
  3. Save file with .c extension
  4. Compile the program
  5. Run and see the output

Example file name:

hello.c

🚀 Practice Programs for Beginners

  • Print your name
  • Add two numbers
  • Find the largest number
  • Calculate area of a circle
  • Create a simple calculator

💡 What You Will Learn Next

  • Variables in C
  • Data Types
  • Operators
  • Input and Output
  • Decision Making
  • Loops

🎯 Congratulations!

You have written your first C program. This is the first step toward becoming a programmer.

Keep Learning & Keep Coding 💻🔥

Next: Variables and Data Types in C Programming 🚀

No comments:

Post a Comment