Wednesday, September 13, 2023

Programing in C Tokens -2

 

Keywords- किसी भी programming language में  पहले ये निर्धारित pre-define कुछ word होते हैं. जिनका use विशिष्ट काम करने के लिए किया जाता हैं. वैसे ही C programming language में कुछ reserved word हैं. जिनका विशिष्ट अर्थ होता हैं. C programming में reserved keyword से variable का नाम नही रख सकते हैं और न ही किसी function का नाम रख सकते हैं.C programming में total 32 reserved keywords हैं. सभी keywords का अपना-अपना अलग-अलग अर्थ होता हैं.

·         C programming में सभी reserved keyword को lowercase में defined किया गया हैं.

·         सभी reserved keyword का अपना-अपना विशिष्ट अर्थ होता हैं जो की प्रोग्रामर उसे change नहीं कर सकता हैं.

·         किसी भी reserved keyword का use प्रोग्रामर व्दारा किसी variable, function, array, point के नाम में नही किया जा सकता हैं.

1) डाटा टाइप कीवर्ड – (Data types)

(i) int - int का उपयोग संख्यात्मक मान (numeric values) को संग्रहीत (store) करने के लिए किया जाता है या यह पूर्णांक मान (integer value) को दर्शाता (indicate) है। उदाहरण: (1, 2, 56….)

(ii) char - char का उपयोग अक्षर मान (character value) को संग्रहीत (store) करने के लिए किया जाता है या अक्षर मान (character value) को दर्शाता (indicate) है। उदाहरण: (a, b, c ….)

(iii) float - float: यह इंगित करता है कि वेरिएबल (variable) एक फ्लोट मान (float value) रखता (hold) है। उदाहरण: (1.15, 2.27, 6.33 ….)

(iv) double -double: मूल रूप से यह फ्लोट डेटा टाइप की तुलना में दशमलव संख्या को अधिक मात्रा के साथ स्टोर करने के लिए उपयोग किया जाता है।

2) क्वालीफ़ायर कीवर्ड – (Qualifier )

(i) signed -signed: यह इंगित करता है कि वेरिएबल (variable) सकारात्मक (positive value) या नकारात्मक मान (negative value) रख सकता है।

(ii) unsigned - unsigned: यह दर्शाता है कि वेरिएबल केवल सकारात्मक मान (positive value) रख सकता है।

(iii) short - short: यह इंगित करता है कि चर काफी छोटा पूर्णांक मान (small integer value) रख सकता है।

(iv) long - long: यह इंगित करता है कि चर काफी बड़ा पूर्णांक मान (large integer value) रख सकता है।

3) लूप कण्ट्रोल स्ट्रक्चर कीवर्ड – (Loop Control Structure )

(i) for, while, do while - for, while, do while का उपयोग लूपिंग के लिए किया जाता है।

4) यूजर डिफाइन कीवर्ड – (User-define type - )

(i) typedef - tydef: इस कीवर्ड का उपयोग मौजूदा डेटा टाइप (data type) का नाम बदलने (rename) के लिए किया जाता है।

(ii)enum - सी प्रोग्रामिंग में कीवर्ड एनम (enum) का उपयोग करके एनुमरेशन टाइप (enumeration type) घोषित किए जाते हैं।

5) जंपिंग कण्ट्रोल कीवर्ड – (jumping control)

(i) break - इस कीवर्ड का उपयोग लूप (loop) को समाप्त (terminate) करने के लिए किया जाता है। इसका उपयोग किसी भी लूप या स्विच केस (loop or switch case) के साथ किया जाता है।

(ii) continue - जारी रखें स्टेटमेंट (statement) पुनरावृत्ति के लिए लूप (loop) के अंदर स्टेटमेंट के बाद स्टेटमेंट को छोड़ देता है या इसका उपयोग कुछ शर्तों के आधार पर लूप के विशेष पुनरावृत्ति को छोड़ने के लिए किया जाता है।

(iii) goto  - इस कीवर्ड का उपयोग प्रोग्राम में निर्दिष्ट स्थान (specified location) पर नियंत्रण भेजने (pass the control) के लिए किया जाता है।

6) स्टोरेज क्लास कीवर्ड – (Storage class keywords )

(i) auto - auto keyword  स्वचालित चर (automatic variable) घोषित (declare) करता है)

(ii) register - register keyword, register variable बनाता है जो सामान्य वेरिएबल की तुलना में बहुत तेज़ होता है।

(iii) static - static keyword एक static variable बनाता है। स्टैटिक वैरिएबल का मान (value) प्रोग्राम के अंत तक बना रहता है।

(iv) extern - एक्सटर्न कीवर्ड घोषित करता है कि एक वेरिएबल (variable) या फ़ंक्शन (function) का घोषित फ़ाइल के बाहर एक्सटर्नल लिंकेज (external linkage) है।

7) फंक्शन कीवर्ड – (Function keywords )

(i) void - void: यह रिटर्न टाइप में से एक है और फंक्शन्स के भीतर उपयोग किया जाता है। वोयड कीवर्ड का अर्थ कुछ भी नहीं या कोई मूल्य (no value) नहीं है।

(ii) return - रिटर्न कीवर्ड फ़ंक्शन (function) को समाप्त (terminates) करता है और मान (value) लौटाता है।

8) decision keywords in hindi

(i) if, else: - इनका उपयोग स्थिति (condition) की जांच करने और स्थिति की संतुष्टि के आधार पर निर्णय (make decision) लेने के लिए किया जाता है।

(ii) switch, case, default - इन कीवर्ड का उपयोग विभिन्न मानों के साथ वेरिएबल की तुलना (compare) करने और स्थिति संतुष्टि के अनुसार निर्णय लेने के लिए किया जाता है। 

9) Derived keywords 

(i) struct  -  कीवर्ड का उपयोग किसी संरचना (structure) को घोषित करने के लिए किया जाता है। एक संरचना एक ही नाम के तहत विभिन्न प्रकार के चर (variable) रख सकती है।

(ii) union - एक यूनियन (union) कीवर्ड का उपयोग विभिन्न प्रकार के वेरिएबल को एक ही नाम (single name) के तहत समूहीकृत (grouping) करने के लिए किया जाता है।

10) other keywords :

(i) const: - इसका उपयोग एक पहचानकर्ता (identifier) को कांस्टेंट (constant) घोषित करने के लिए किया जाता है।

(ii) volatile - इसका उपयोग वोलेटाइल वैरिएबल बनाने के लिए किया जाता है, जिसका अर्थ है कि इसका मूल्य प्रोग्राम (program) के बाहर, कुछ बाहरी स्रोतों (external sources) द्वारा बदला या  संशोधित (modified) किया जा सकता है।

(iii) sizeof - इस कीवर्ड का उपयोग मेमोरी (memory) में किसी वेरिएबल या डेटा टाइप के आकार (size) को जानने के लिए किया जाता है।

 

Identifiers

C programming में identifiers program में name को represent करते हैं. ये नाम कोई भी variable, functions, arrays, structures,  labels आदि हो सकते हैं. एक identifier बनाने के लिए उसके name uppercase letters, lowercase letters, underscore  और digits से मिलाकर बना सकते हैं. लेकिन starting में alphabet या underscore होना चहिये किसी digits को नहीं ले सकते हैं इस प्रकार हम कह सकते हैं की एक identifiers collection of alphanumeric characters होता हैं. एक  identifiers name alphabetical character या  underscore से start होता हैं. identifiers का use किसी भी variables, functions, arrays, unions, labels आदि को represent करते हैं program के अंदर. identifiers को 52 alphabetical characters जो की uppercase और  lowercase दोनों हो सकते हैं. इसके अलाबा underscore और 10 number (0-9) हो सकते हैं.

Rules For Naming Identifiers in Hindi |Identifiers के नामकरण के नियम

·         C programming में किसी भी identifier का पहला character कोई भी alphabet या underscore होना चहिये.

·         पहला character के बाद कोई भी alphabet, underscore या digit हो सकता हैं.

·         C programming में किसी भी identifier का पहला character digit नहीं हो सकता हैं.

·         C programming में identifier का case-sensitive होते हैं. यानी की uppercase और lowercase letters दोनों अलग-अलग होते हैं.

·         identifier के बीच में Commas या blank spaces नहीं दिया जा सकता हैं.

·         C programming language में किसी भी Keywords को identifier के रूप में represented नहीं किया जा सकता हैं.

·         C programming में identifiers में अधिकतम 31 characters हो सकते हैं.

·         identifiers एक scope में unique होता हैं.

C programming में identifier दो प्रकार के होते हैं.

1.      Internal identifier

2.      External identifier

Internal Identifier -C programming में Internal Identifier वे होते हैं. में  external linkage में Identifier का use नहीं जा सकता हैं. इसे Internal Identifier कहते हैं. internal identifiers local variables हो सकते हैं.

External Identifier -C programming में External Identifier वे होते हैं. में  external linkage में Identifier का use जा सकता हैं. इसे External Identifier कहते हैं. External identifiers global variables , function names हो सकते हैं.

Differences between Keywords and Identifiers in Hindi | Keywords और Identifiers के बीच अंतर

S. No

Keywords

Identifiers

1.

Keywords C programming में पहले से ही define (pre-defined) हैं.

identifiers C programming में user-defined होते हैं.

2.

Keywords को C programming में केवल lowercase में ही लिखा जाता हैं.

identifiers को lowercase और uppercase  दोनों letters में लिखा जा सकता हैं.

3.

Keywords का मतलब C का compiler पहले से ही समझता हैं.

identifiers का मतलब C का compiler पहले से नहीं ही समझता हैं.

4.

Keywords collection of alphabetical characters होते हैं.

identifiers collection of alphanumeric characters होते हैं.

5.

Keywords underscore character नहीं होता हैं.

identifiers में underscore character  हो सकता हैं.

 

Constant- 

 - programming में constant fixed value को refer करता है जो की एक बार define हो जाने के बाद program के execution के दौरान उसका value change नहीं किया जा सकता है| Fixed value को literal कहा जाता है| दूसरे शब्दों में कहें तो Memory location का ऐसा नाम जिसमें program के execution के दौरान value change नहीं किया जा सकता है उसे Constant कहते हैं| यदि किसी constant का value program के execution के दौरान change करने की कोशिश किया जाये तो compilation error मिलता है| 

C constant के प्रकार 

  • Integer Constant
  • Floating point constant
  • String constant
  • Character constant

String -

  • C प्रोग्रामिंग में, String (स्ट्रिंग) characters का एक क्रम होता है और इसे null (‘\0’) के द्वारा terminate (समाप्त) किया जाता है.  
  • दूसरे शब्दों में कहें तो, “स्ट्रिंग, characters का एक one-dimensional array होता है जिसे null के द्वारा terminate किया जाता है.”
  • String का सबसे अंतिम character हमेशा null (‘\0’) होना चाहिए. इससे पता चलता है कि string कहाँ पर खत्म हो रही है.

  • Strings को हमेशा double quotes के अंदर रखा जाता है. जबकि character को single quote के अंदर रखा जाता है.

  • Array में प्रत्येक character एक byte मैमोरी लेता है.

  • इसका example – char c [] = “person”Operators (ऑपरेटर): जो वे विशेष सिम्बोल होते हैं जो दो या अधिक आइटम्स के बीच एक ऑपरेशन को दर्शाते हैं। 

No comments:

Post a Comment

Tally

  अकाउंटिंग आधुनिक व्यवसाय का आकार इतना विस्तृत हो गया है कि इसमें सैकड़ों , सहस्त्रों व अरबों व्यावसायिक लेनदेन होते र...