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++
- Open Dev C++ and go to File → New → Source File.
- Copy the code shown below into the editor.
- Save the file with a
.cextension likefirst.c. - Click Execute → Compile & Run or press F11.
- The output window will display:
Hello, World!
यह एक साधारण C प्रोग्राम का स्ट्रक्चर है। चलिए Dev C++ में इसे रन करने के स्टेप्स समझते हैं।
Dev C++ में रन करने के स्टेप्स
- Dev C++ खोलें और File → New → Source File पर जाएं।
- नीचे दिया गया कोड editor में पेस्ट करें।
- फाइल को
.cएक्सटेंशन के साथ सेव करें, जैसेfirst.c। - Execute → Compile & Run पर क्लिक करें या F11 दबाएं।
- Output विंडो में
Hello, World!दिखाई देगा।
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;: प्रोग्राम को सफलतापूर्वक समाप्त करता है।