Chapter 3 (C Tokens)


C Tokens 

C Language में हम कुछ terms (words, punctuation etc. )  use करते हैं जिनको Token कहते हैं।  Token किसी भी programme code में छोटे-छोटे block or terms होते हैं। 




C Programming में use होने वाले Tokens नीचे mentioned हैं :-


👉 Identifiers 

Identifier mainly हमें code में use  किये हुए variables or functions के nature के बारे में बताता हैं कि आपका  variable or function किस type का है। 




Identifier को define करते समय कुछ बातों को ध्यान रखना चाइये , जैसे कि ---

  • Identifier का पहला character किसी तरह का special symbol (@, $, and %) or punctuation character नहीं होना चाईए।  
  • Identifier का पहला character हमेशा A-Z, a-z , या underscore '_' ही होना चाईए। जो कि compiler की नज़रों में valid होता है। 
  • Identifier को define करने में आप किसी  reserved words or keyword का  use नहीं कर सकते। 
  • Identifier को define करने में आप किसी तरह का whitespace use नहीं कर सकते। 
  • और सबसे main or important point कि Identifier case sensitive होते हैं , means 'ABC' और  'abc' दोनों अलग - अलग  हैं compiler के लिए। 

for example :- 

int abc;

float ABC;

double _abc


ऊपर दिए गए example में 'abc', 'ABC' और '_abc' Identifier हैं और 'int', 'float' और 'double' keyword हैं। 


👉 Keywords or Reserved Words

वे words जो किसी perticular task के लिए पहले से define किये हुए हैं , उन्हें ही Reserved words or Keywords कहते हैं।



 C Language में 32 keywords होते हैं --


auto

double

int

struct

break

else

long

switch

case

enum

register

typedef

char

extern

return

union

const

float

short

unsigned

continue

for

signed

void

default

goto

sizeof

volatile

do

if

static

while


👉 Constants

Constants variable की तरह ही होते हैं।  लेकिन during the execution of programme,  एक बार define करने के बाद इनकी value कभी change नहीं होती।  




Syntax :-

Const Type constant_name;

or

Type Const constant_name;

ऊपर दिए हुए syntax में :-

  • 'Const'  = एक keyword/ reserved word है जो कि constant को define करने के लिए use करते हैं। 
  • 'Type'     = यहाँ हमें C compiler को बताना होता है कि हम किस type का constant define कर रहे हैं। 
  • 'Constant_name' = यहाँ हमें constant variable का name देना होता है। 

Example on Turbo C programming :- 



Output :-



👉 String

Group of character is called String, In other words we can say that one dimensional array of character is called String.


Syntax :-

Data_Type string_name [string size];

or

Char name [] = {'character'};


ऊपर दिए हुए syntax में :-

  • 'Data_type'  = यहाँ हमें C compiler को बताना होता है कि हम किस type का string define कर रहे हैं।  
  • 'string_name' = यहाँ हमें string variable का name देना होता है। 
  • 'string_size' :- यहाँ हमें string character size देना होता है। ताकि उसी के according हमारी कंप्यूटर मेमोरी में space allocate हो जाये। 

Example on Turbo C programming :- 



Output:-


👉 Operators

Operators वो  symbols होते हैं जिनका use mathematical or logical operations में किया जाता हैं। 




 C Language में बहुत से operators हैं :-

  • Arithmetic Operators
  • Relational Operators
  • Logical Operators
  • Assignment Operators
  • Increment and Decrement Operators
  • Conditional Operator
  • Bitwise Operators
  • Special Operators

Arithmetic Operators :-

Arithmetic Operators का use mathematical operations [ Addition (+) , Subtraction (-), Multiplication (*), Division (/), Modulus (%) ] perform करने में किया जाता हैं। 



Relational Operators:-

Relational operators mainly comparision के लिए use किये जाते हैं। 




Logical Operators :- 

C Language में mainly 3 logical operators का use किया जाता है :-

  • Logical AND (&&)
  • Logical OR (||)
  • Logical NOT (!)



Assignment Operators :- 

Assignment Operators का use हम value को variable में assign करने के लिए करते हैं। 





Conditional Operators :-

Conditional Operators का use हम तब करते हैं जब एक से जायदा condition हो। 



Bitwise Operators :-

Bitwise Operators का use memory allocation or de allocation के लिए किया जाता हैं। 



Special Operators :-

C Language कुछ special operators भी offer करता है। 




👈 PREVIOUS                                                                                                        👉 NEXT       

आपको मेरा ये पोस्ट कैसा लगा, कृप्या नीचे दिए गए comment box me comment करके बताये। यदि आपको मेरा पोस्ट अच्छा लगा हो तो like करे और अपने दोस्तों के साथ भी share करे।
और किसी प्रकार की शिकायत या सुझाव हो तो भी आपका स्वागत है।

Post a Comment

0 Comments