Introduction to Flowchart Flow chart किसी process का graphical representation होता है। C language के सन्दर्भ में यह program के execution flow का graphical presentation होता है। प्रायः जब भी आप कोई program लिखते है तो बिना किसी flow chart के लिखते है। किसी दूसरे व्यक्ति द्वारा इसे समझना असंभव होता है। Flow chart के माध्यम से आप अपने program को graphically represent करते है। ऐसा करने से कोई भी आपके program के logic को आपके बिना भी समझ सकता है। जब आप किसी company के लिए programmer के रूप में काम करते है तो coding से पहले flowchart बनाना अनिवार्य होता है। ऐसा इसलिए किया जाता है क्योंकि companies में अक्सर programmers बदलते रहते है। आपके द्वारा बनाये गए किसी project को कोई दूसरा व्यक्ति आसानी से समझ सके और उस पर काम कर सके इसलिए आपको flow charts create करना अनिवार्य होता है। Flow chart create करने का एक महत्वपूर्ण कारण ये है की इससे आपको program की गहरी समझ प्राप्त होती है। आप coding से पहले ही उसमे आने वाली errors और result को देख पाते है। यदि flowchart completely prepare कर लिया ग...
Posts
Single and Multiple Line Comments
- Get link
- X
- Other Apps
Comments एक comment आपके program में वो text होता है जिसे compiler ignore कर देता है। ये text बाकी statements की तरह execute नहीं होता है। Comments program में किसी statement को या फिर program को define करने के लिए use किये जाते है। /* Your comment will be here */ C language में comments define करने के लिए forward slash (/) और asterisk (*) का प्रयोग किया जाता है। #include <stdio.h> int main() /* Main function starts from here*/ { printf(“Hello World!”); /* This statement will print Hello World message */ return 0; } ऊपर दिए गए program में comments के माध्यम से program और दूसरे statements के बारे में explanation दी गयी है। Hello World!
Structure of C Program
- Get link
- X
- Other Apps
Structure of C Program Your First C Program /* Header file declaration */ #include<stdio.h> /* Main function declaration */ int main() { /* Printing message to screen */ printf(“Hello Readers!”); /* returning */ return 0; } Hello Readers! सबसे पहली line में <stdio.h> header file को program में include किया गया है। ये एक standard input/output header file होती है जो program में input और output को handle करती है। इन्हें program में include करने के लिए preprocessor directives का प्रयोग किया जाता है। इसके बाद main() function को start किया गया है। Main function से ही program का execution start होता है। इसी function में सभी instructions लिखे जाते है। Main function का start और end curly brackets के द्वारा show किया जाता है। इन curly brackets के भीतर के सभी instructions execute किये जाते है। Main function को int type के साथ define किया गया है।...
C Program Development Life Cycle
- Get link
- X
- Other Apps
C Program Development Life Cycle C में कोई भी program create करने के 4 steps होते है। ये steps एक निश्चित क्रम में होते है और इनमें से हर step का अपना महत्व होता है। सबसे पहले आप एक program को लिखते है। इसे program development life cycle का editing part कहते है। ये program human readable format में होता है। इसके बाद आप program को compile करते हैं। ये development life cycle का second step होता है। इस part में सभी errors को remove करके program को binary format में convert किया जाता है ताकि computer इसे process कर सके। इसके बाद linking process आती है। इस process में program को जरूरी libraries के साथ link किया जाता है। जैसे की आपको पता है की C का basic program भी बिना libraries को include किये नहीं execute हो सकता है। Libraries C program को execute होने के लिए environment provide करती है। इसके बाद executable file produce कर दी जाती है। जिसे आप जितनी बार चाहे execute कर सकते है। Editing process का output .c source file होती है। Compilin...
Introduction to C Constants
- Get link
- X
- Other Apps
Introduction to C Constants Constants वो variables होते है जिनकी value program execution के दौरान किसी प्रकार भी change नहीं होती है। जब भी आप कोई constant declare करते है तो program के execution के दौरान उसकी value fixed रहती है। यदि इसकी value change करने की कोशिश की जाती है तो program में error आ जाती है। C language में constants दो types के होते है। Constant Literals Constant Variables इन दोनों types के constants के बारे में निचे detail से बताया जा रहा है। Constant Literals Constant literals ऐसी values होती है जिन्हें आप program में directly use करते है। उदाहरण के लिए निचे दिए गए code को देखिये। y = x+2; ऊपर दिए गए statement में 2 एक constant literal है। इसे program में directly use किया गया है। इसे program के execution के दौरान change नहीं किया जा सकता है। Constant literals को आप ऐसी direct values समझिये जिन्हें change नहीं किया जा सकता है। आम तौर पर literal constants को use करने की सलाह नहीं दी जाती है। मान लीजिये...
Introduction of Variables & Constants
- Get link
- X
- Other Apps
Introduction of Variables & Constants यदि आप किसी data के साथ operations perform करना चाहते है तो इसके लिए सबसे पहले आपको उसे computer की memory में store करना पड़ता है। Computer memory में data को store करने के लिए variables का प्रयोग किया जाता है। एक variable memory में किसी location का नाम होता है। यह नाम (या variable) उस memory location को computer की संपूर्ण memory में uniquely identify करने के लिए प्रयोग किया जाता है और इसी नाम के द्वारा आप उस memory location में data store करते है और उस data को पुनः प्राप्त करते है। उदाहरण के लिए ये आपके computer का memory space है। आप computer की memory में कुछ data store करना चाहते है। जैसे की किसी व्यक्ति का नाम, उम्र आदि। Computer की memory में data store करवाने से पहले आप बताते है की आप किस तरह का data store करेंगे। यह आप data types के द्वारा define करते है। उसी के अनुसार आपको memory में space मिलता है। यानि की यदि आपने int define किया है तो 2 bytes variable को memory में compiler allot करेगा। इसके बाद आपको उस me...
Introduction to C Data Types
- Get link
- X
- Other Apps
Introduction to C Data Types जब भी आप कोई variable create करते है तो उससे पहले compiler को बताते है की आप किस तरह का data उस variable में store करेंगे। इससे compiler उतनी ही memory उस variable को computer की memory में से allot कर देता है। /* A Integer type variable */ int age; ऊपर दिया गया statement compiler को बताता है की आप age variable में एक whole number (बिना दशमलव के) store करने वाले है। किसी भी whole number को store करने के लिए जितनी memory की आवश्यकता होती है compiler उतनी इस variable को allot कर देता है। जो की 2 bytes है। यदि किसी programming language में data types ना हो तो बहुत अधिक memory waste हो सकती है। जब 2 bytes की आवश्यकता हो तब 20 bytes आप waste कर सकते है। इसलिए जितनी भी तरह का data आप store कर सकते है उसके लिए पहले से ही maximum memory limit define की गई है। Different C Data Typ...