Your First C Program

Step-by-step guide to write, compile, and run your first C program using Dev C++.

This is the basic structure of a C program. Let's understand how to run it using Dev C++.

Steps to Run in Dev C++

  1. Open Dev C++ and go to File → New → Source File.
  2. Copy the code shown below into the editor.
  3. Save the file with a .c extension like first.c.
  4. Click Execute → Compile & Run or press F11.
  5. The output window will display: Hello, World!

यह एक साधारण C प्रोग्राम का स्ट्रक्चर है। चलिए Dev C++ में इसे रन करने के स्टेप्स समझते हैं।

Dev C++ में रन करने के स्टेप्स

  1. Dev C++ खोलें और File → New → Source File पर जाएं।
  2. नीचे दिया गया कोड editor में पेस्ट करें।
  3. फाइल को .c एक्सटेंशन के साथ सेव करें, जैसे first.c
  4. Execute → Compile & Run पर क्लिक करें या F11 दबाएं।
  5. Output विंडो में Hello, World! दिखाई देगा।
Dev C++ First Program Screenshot

Code: Hello World Program

#include <stdio.h>

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

Output:

Hello, World!

Explanation (English):

  • #include <stdio.h>: Adds standard input-output library.
  • main(): Entry point of the program.
  • printf(): Prints message to the console.
  • return 0;: Ends the program successfully.

व्याख्या (Hindi):

  • #include <stdio.h>: इनपुट-आउटपुट के लिए स्टैंडर्ड लाइब्रेरी।
  • main(): प्रोग्राम की शुरुआत का पॉइंट।
  • printf(): स्क्रीन पर मैसेज प्रिंट करता है।
  • return 0;: प्रोग्राम को सफलतापूर्वक समाप्त करता है।