Basic of C in hindi
What is C language ? (C language क्या है?):
C language एक उत्कृष्ट High Level Language (HLL) है, इस भाषा में बना प्रोग्राम छोटा होता है। इसमें बहूत सारे Library Function होते हैं, जो कि Program को छोटा बनने में सहायक है।
Historical of C:
Where and why is C used:
पहले C का use,System Programming के लिए किया जाता था, लेकिन आज इसका use सभी तरह के कार्यों को करने के लिए हो रहा है। हम C के व्दारा Mechanical Project,Electronics Project, Circuit Diagrams, 3D Animation Games तथा और भी बहूत सारे Graphical Programs बना सकते हैं।
Rules for Creating a C Program:
Fundamental of C1.Program में सभी key-Words को Lower case में लिखा जाता है जैसे- auto,int,double,if,else,while आदि।
2.C case sensitive होते हैं, जैसे if else IF ELSE से अलग है।
3.key-words(if,else,while,exit) का उपयोग किसी भी दूसरे उद्धेश्य के लिए नही होता है, अर्थात् ये फलन के नाम के Variable के रूप में उपयोग नहीं हो सकता है।
4.comments के लिए /*................*/ या // का उपयोग किया जाता है।
Keywords:
auto double int struct |
case enum register typedef
char extern return union
const float short unsigned
continue for signed void
default goto sizefo volatile
do if static while
Structure of C Programs:
Documentation Block |
Link Block
Definition Block
Global Declaration Block
main() Function Block
{
Declaration
Executable Statements
}
User-Defined Function Block
Function 1
Function 2
Function 3
Function...n
- Documentation Block में, यूजर प्रोग्राम का विवरण, उसका उद्धेश्य, प्रोग्राम का शीर्षक, यूजर का नाम आदि लिख सकता है।
- Link block में, System library से Functions को लिंक करने के लिए Compilers को निर्देश देता है।
- Definition Blockमें, सभी चिन्हित स्थिरांक परिभाषित होते हैं।
- Global Declaration Block कूछ Variable की आवश्यकता विभिन्न Functions में होती है तथा ऐसे Variables को Global Variableकहते हैं। Global Variable को Global Declaration Block में Declare करते हैं।
- Main Function Block C program में एक main() Function होता है। इस Block के अन्तर्गत मुख्यत: दो भाग होते हैं,Declaration तथा Executable Statements पहले भाग में वे सभी Variable आते हैं, जो main() Function block में उपयोग में लाये जाते हैं।
कम से कम एक Statement दूसरे भाग में होना चाहिए जो Executable Statement Block होता है। दोनों भाग {} कोष्ठक व्दारा बंद होत हैं। - User-Defined Function Block, main() function block के बाद, Program में user function की आवश्यकता होती है, कई Sub Programs जिन्हें User Defined Function कहते हैं। Program को पुनरार्वति से बचाते हैं तथा बदलाव करने में सक्षम बनाते हैं। ये Sub Programs main() function में call किये जात हैं।
/* A Program to greet the user. */
#include<stdio.h> */ Header file */
#include<conio.h>
main()
{
clrscr(); /*This function use for clears the screen*/
printf("Hello user!, Welcome in world of C");/*This function use for prints on the screen*/
}
ऊपर एक बहूत ही Simple Program बताया गया है, यह Program Hello user!, Welcome in world of C को print करेगा।
Leave a Comment