C Constants and Literals in Hindi

इस Article में C Constants in Hindi और C Literals in Hindi के बारे में जानेगे।
C Constants in Hindi
Constants का Use भी Value को Store करने के लिए किया जाता है। ये भी Variable की तरह होता है लेकिन इसमें जो Value Store की जाती है वो Fixed value होती है उसे Program Execution के Time Change या Modify नहीं किया जा सकता है।
Syntax of C Constants in Hindi
Constant Variable को Create करने के लिए const Keyword का Use किया जाता है।
const type variable = Value;
अब इसका एक Example देखते है।
#include<stdio.h> #include<conio.h> int main() { const int x = 10; printf("%d", x); }
Output
10
ये एक Simple Example है। जिसमे एक Const Variable Create करते है और उसको Screen पे Display करते है।
C Literals in Hindi
Literals in C in Hindi – Constant Variable को दी गयी Value Literals कहलाती है। जो Value Change नहीं होती है , वो Literals कहलाती है। ये 4 प्रकार की होती है।
Integer Literals
Integer Literals में decimal, Octal, Hexadecimal, long आदि Value होती है।
Floating-Point Literals
Floating Point भी Integer का Part है। इसमें दशमलव संख्या होती है।
Character Literals
Character Literals enclosed Single Quotes में होते है।
String Literals
String Text का Collection होती है। जिसे Double Inverted (” “) Commas में लिखा जाता है।
Second Way Define Constant
जैसे की ऊपर जान चुके है। की Constant Variable Create करने के लिए const keyword का Use किया जाता है। लेकिन इसको #define Preprocessor से भी Create (define ) कर सकते है।