top of page

Basic Structure of C Program (C प्रोग्राम की मूल संरचना)

  • Writer: Siddharth Sharma
    Siddharth Sharma
  • Sep 2, 2025
  • 2 min read

1. Introduction (परिचय)

C Programming का structure एक predefined format होता है जिसमें हर C program को लिखा जाता है। यह structure program को readable और systematic बनाता है।

Basic structure of C programming

2. Basic Structure of C Program (C प्रोग्राम की मूल संरचना)

एक C प्रोग्राम मुख्यतः निम्नलिखित parts से मिलकर बना होता है:


  1. Documentation Section (डॉक्यूमेंटेशन सेक्शन)

    • Program की शुरुआत में comments लिखे जाते हैं।

    • इसका उपयोग program का उद्देश्य, लेखक का नाम, तिथि आदि लिखने के लिए किया जाता है।

    • Example:

    • /* Program to calculate sum of two numbers

    •    Author: Siddharth

    •    Date: 02/09/2025 */


  2. Link Section (लिंक सेक्शन)

    • Header files को include करने के लिए use किया जाता है।

    • ये files predefined functions और macros को program में लाती हैं।

    • Example:

    • #include <stdio.h>

    • #include <conio.h>


  3. Definition Section (परिभाषा सेक्शन)

    • यहां symbolic constants और macros define किए जाते हैं।

    • Example:

    • #define PI 3.14


  4. Global Declaration Section (वैश्विक घोषणा सेक्शन)

    • यहां global variables और user-defined functions की declaration होती है।

    • Example:

    • int total; 

    • void sum();


  5. Main Function Section (मुख्य फंक्शन सेक्शन)

    • हर C program की execution main() function से शुरू होती है।

    • इसमें दो भाग होते हैं:

      • Declaration Part (घोषणा भाग) → Variables declare किए जाते हैं।

      • Executable Part (निष्पादन भाग) → Statements लिखे जाते हैं।

    • Example:

    • int main() {

    •     int a, b, sum;

    •     a = 10;

    •     b = 20;

    •     sum = a + b;

    •     printf("Sum = %d", sum);

    •     return 0;

    • }

  6. Subprogram Section (उप-प्रोग्राम सेक्शन)

    • इसमें user-defined functions लिखे जाते हैं।

    • Program को modular और आसान बनाने के लिए functions का प्रयोग किया जाता है।

    • Example:

    • void sum() {

    •     int x = 5, y = 15;

    •     printf("Sum = %d", x + y);

    • }

3.       Diagram (C Program Structure का चित्रात्मक रूप)

 

Structure of C programming
Structure of C programming

4. Conclusion (निष्कर्ष)

C program का structure निश्चित format में होता है। यह programmer को program को logically और systematically लिखने में सहायता करता है। हर section का अपना महत्व है और पूरा program एक organized flow में चलता है।

 

 
 
 

Comments


bottom of page