https://www.rakeshmgs.in/search/label/Template
https://www.rakeshmgs.in
RakeshMgs

First C Program and Its Structure Hindi Notes | C Programming Notes in Hindi

Updated:

First C Program and its Structure

C में कोई भी program create करने के 4 steps होते है। ये steps एक निश्चित क्रम में होते है और इनमें से हर step का अपना महत्व होता है।

  1. सबसे पहले आप एक program को लिखते है। इसे program development life cycle का editing part कहते है। ये program human readable format में होता है।
  2. इसके बाद आप program को compile करते हैं। ये development life cycle का second step होता है। इस part में सभी errors को remove करके program को binary format में convert किया जाता है ताकि computer इसे process कर सके।
  3. इसके बाद linking process आती है। इस process में program को जरूरी libraries के साथ link किया जाता है। जैसे की आपको पता है की C का basic program भी बिना libraries को include किये नहीं execute हो सकता है। Libraries C program को execute होने के लिए environment provide करती है।
  4. इसके बाद executable file produce कर दी जाती है। जिसे आप जितनी बार चाहे execute कर सकते है। Editing process का output .c source file होती है। Compiling process का input source .c file होती है और output .obj file होती है। Linking process का input .obj file होती है और output .exe file होती है।
    
#include <stdio.h> int main() { // printf() displays the string inside quotation printf("Hello, World!"); return 0; /* multi line comments/* }

Output:-

Hello,World

Different parts of C program

  • Pre-processor
  • Header file
  • Function
  • Variables
  • Statements & expressions
  • Comments

Pre-processor

#include किसी भी C प्रोग्राम का पहला शब्द है। इसे Pre-processor के रूप में भी जाना जाता है। Pre-processor का कार्य environment of the program को इनिशियलाइज़ करना है, अर्थात program को आवश्यक हेडर फाइलों से जोड़ना है। इसलिए, जब हम #include कहते हैं, तो संकलक को प्रोग्राम को निष्पादित करने से पहले stdio.h हेडर फ़ाइल को प्रोग्राम में शामिल करना है।.

इसलिए, जब हम #include<stdio.h> कहते हैं, it is to inform the compiler to include the stdio.h तो संकलक को प्रोग्राम को निष्पादित करने से पहले stdio.h हेडर फ़ाइल को प्रोग्राम में शामिल करना है।

Header file

सबसे पहली line में <stdio.h> header file को program में include किया गया है। ये एक standard input/output header file होती है जो program में input और output को handle करती है।

main() function

Main function को int type के साथ define किया गया है। ये एक standard है। Main function को हमेशा एक integer value return करनी होती है। यदि आप program में main() function से कोई value return नहीं करते है तो program के आखिर में return 0 statement लिखते है।

Comment

एक comment आपके program में वो text होता है जिसे compiler ignore कर देता है। ये text बाकी statements की तरह execute नहीं होता है। Comments program में किसी statement को या फिर program को define करने के लिए use किये जाते है।.
C language में comments define करने के लिए single line comment (//) और multiple line comment (/*....*/) का प्रयोग किया जाता है।

आपको यह आर्टिकल कैसा लगा हमें कमेंट करके सपोर्ट जरुर करे ताकि हम आपके लिए ऐसे ही और आर्टिकल तथा नोट्स बना सके।


आपको आर्टिकल कैसा लगा? अपनी राय अवश्य दें
Please don't Add spam links,
if you want backlinks from my blog contact me on rakeshmgs.in@gmail.com