For
my dear friends who don’t understand HINDI can
access the same content on my ENGLISH post.
The reason for posting in HINDI too was to help many people who prefer HINDI over ENGLISH.
हेलो Friends, हम सब आज के दौर में Computer Programming की जरूरत समझते हैं । ये posts उन E-Books या अन्य content से अलग होंगे, जो आजकल internet
पे available हैं । इन posts को पढ़ने से ऐसा लगेगा की आप एक अच्छे programmer,
teacher से direct सीख रहे हो। Friends, शुरू करने से पहले में आपको बता दू की हिंदी में लिखना मुश्किल है पर पढ़ना आसान है , ये बात हम सब जानते हैं और GOOGLE भी अपने events में regional languages को बढ़ावा दे रहा है। मुझे भी ऐसे एक event में शामिल होने के बाद HINDI में लिखने का motivation मिला । पर , computer
languages के मामले में कुछ चीजे ENGLISH में अच्छी समझ आती है, पर हिंदी की बात ही कुछ और है। तो चलिए शुरू करते है।
C PROGRAMMING क्यों सीखे? C के फायदे?
एक राय
जो आज
अक्सर सुनी
जाती है
वह है
- “C पहले से
ही C++, C#
और Java जैसी languages से पिछड़
गयी है, तो आज
C को
क्यों सीखा
जाये? इसका answer बहुत simple है । C++
और JAVA को सीखने का base आपको C language से
ही मिलेगा ।C++,
C# और JAVA में OOPS concept के फायदे है (जो आप बाद में सीखेंगे) पर फिर भी अगर आपको C की basic programing skills आती है तो आपको बहुत मदद मिलेगी। C language से ही बाकि languages के compilers बनाये जाते है। C से काफी operating systems भी बनाए गए है। इसके अलावा भी C के बहुत फायदे है। ये आपके ऊपर depend करता है की आप C क्यों सीख रहे है?
Code::blocks कैसे install करे?
अपना पहला program बनाने से पहले हमें 2 चीज़ो की जरुरत पड़ेगी IDE(Integrated Development
Environment) और compiler, IDE जिसमे हम coding करते है
और Compiler उस code को hardware के साथ communicate करवाने में मदद करता है।
Compiler is a program that converts instructions into a machine-code or lower-level form so that they can be read and executed by a computer.
आप Code::blocks download करने का video tutorial भी देखले जिससे आपको मदद मिलेगी।
Note: - कुछ functions आपके compiler पे भी depend करते है। जैसे अगर आपने पहले थोड़ी programming की हो TURBO C++ compiler में (जिसे C
के लिए भी use कर सकते है), तो आप वहा clrscr() function use करते थे पर code::blocks उसे support नहीं करता है। ऐसी और भी चीज़े आपको programming करते हुए अपने आप पता चल जाएंगी।
Error Displayed:- Undefined reference to 'clrscr'.
But ये program TURBO C++ में आसानी से चलेगा बिना किसी error के।लेकिन में आपको Code::blocks suggest करुँगा क्युकी ये थोड़ा advanced, नया, handy IDE+Compiler है। IDE और Compiler के बारे में मैं आपको पहले बता चुका हूँ।
But ये program TURBO C++ में आसानी से चलेगा बिना किसी error के।लेकिन में आपको Code::blocks suggest करुँगा क्युकी ये थोड़ा advanced, नया, handy IDE+Compiler है। IDE और Compiler के बारे में मैं आपको पहले बता चुका हूँ।
तो चलिए हम आपको C Language के program (HELLO WORLD) का use करके program का basic syntax बताते
है।
- · #include :- #include एक pre-processor directive है जिससे हम header files अपने program में डालते है।
- · Header files:- Header Files में कई functions पहले से feed यानि defined होते है ताकि programmer उन functions का use कर सके। जैसे printf() function पहले से <stdio.h> header file में defined है, जिसका use करके हम text को screen पे display करवाते है। इसी तरह scanf() function भी <stdio.h> header file में defined है जिससे हम value store करवाते हैं। ठीक इसी तरह sqrt() function , जिससे हम किसी नंबर का squareroot निकाल सकते है वो <math.h> header file में pre-defined है। तो किसी भी function को use करने से पहले हमें वो header file include करनी होती है जिसमे वो function pre-defined है। अगर हम sqrt() function use करते है और <math.h> header file को include नहीं करते, तो compiler हमें error दिखा देगा।
Note:- In <stdio.h>
stdio stands for standard input /output. It has many standard input output
library function pre-defined in it. Similarly, <conio.h> stands for console input/output which has functions like clrscr() & getch() predefined in it. clrscr() is not supported by code::blocks but if you are using TURBO C++ then it is used to clear the previous program's content from screen for our new program. getch() is used to hold the output content on screen after running of program as when we click on run the output could disappear within fraction of second.




2 Comments
Osm
ReplyDeleteThanks. Subscribe for latest updates.
Delete