JOIN us on
WhatsApp Group Join Now
Telegram Join Join Now

हिंदी माध्यम नोट्स

Class 6

Hindi social science science maths English

Class 7

Hindi social science science maths English

Class 8

Hindi social science science maths English

Class 9

Hindi social science science Maths English

Class 10

Hindi Social science science Maths English

Class 11

Hindi sociology physics physical education maths english economics geography History

chemistry business studies biology accountancy political science

Class 12

Hindi physics physical education maths english economics

chemistry business studies biology accountancy Political science History sociology

Home science Geography

English medium Notes

Class 6

Hindi social science science maths English

Class 7

Hindi social science science maths English

Class 8

Hindi social science science maths English

Class 9

Hindi social science science Maths English

Class 10

Hindi Social science science Maths English

Class 11

Hindi physics physical education maths entrepreneurship english economics

chemistry business studies biology accountancy

Class 12

Hindi physics physical education maths entrepreneurship english economics

chemistry business studies biology accountancy

Categories: c++ language in hindi

C++ : Variable Basic & Integer Type , what is Variable Basic & Integer Type in c++ language in hindi

what is Variable Basic & Integer Type in c++ language in hindi , C++ : Variable Basic & Integer Type :-
C++ एक object-oriented programming language है | अतः इसमें प्रोग्रामर खुद की variable को बनाया जा सकता है |लेकिन प्रोग्रामर को variable declamation मे सतर्क रहना चाहिए | यूजर define variable को बनाने से पहले , प्रोग्रामर को इसके standard को समजना चाहिए जिससे की वो एक efficient variable बना सके |
C ++ मे दो प्रकार के variable type होते है :-
1.Fundamental Type
2.Compound Type
इस article मे , variable के basic और Fundamental Type मे से integer type को discuss करेगे |
Variable Basic
किसी programming language मे , किसी इनफार्मेशन को store करने के लिए memory मे space की जरूरत होती है |अतः किसी item/element की इनफार्मेशन को store करने के लिए ,प्रोग्राम को तीन fundamental properties को ध्यान मे रखना होता है |
-information कहा store होगी ?
-किस तरह की value store होगी ?
-value क्या होगी ?
इसे एक उदाहरण से समजा जा सकता है :
#include<iostream.h>
#include<conio.h>
void main()
{
using name space std;
int a ;
cout<<“Enter value”<<endl;
cin>>a;
char p;
p=g;
cout<< “Charecter”<<p<<“has a value”<<a<<endl;
getch();
}
इस उदहारण मे दो variable को declare किया गया है |
1.int a : ये एक integer type variable है जो की यूजर द्वारा input की गयी value को hold करता है |इसमें int : type of information , a : space for information है |
2.char p : ये एक character  type variable है जो की alphabet  ‘g’  को hold करता है |इसमें char : type of information , p : space for information  और  alphabet ‘g’ : value of information  है |
Naming of Variable
जब किसी variable को declare किया जाता है c++ मे कुछ standard होते है जिसे प्रोग्रामर को फॉलो करना होता है |ये standard निन्म है :-
1.variable name मे केवल character , digits और अंडरस्कोर ( _ ) को use कर सकते है |
2.Upper case को lower case character से अलग consider किया जाता है |
3.variable name का पहला character , कभी भी डिजिट नहीं हो सकता है |
4.c++ keyword को variable name नहीं हो सकता है |
5.C++ मे variable name की length की कोई limit नहीं होती है |
6.अगर variable name मे , पहले एक या  दो underscore और उसके बाद upper score character , C++ Compiler द्वारा एसे variable को implementation मे reverse किया जाता है |
कभी कभी कुछ variable name complier error नहीं देते है लेकिन misbehave जरुर करते है |इसका मतलब है की variable name मे कोई error नहीं है लेकिन इन variable को implementation के लिए reverse किया गया है |इसका उदाहरण है :
_time_stop और _dunut आदि |
नीचे कुछ variable name की लिस्ट है :
variable
status
int
marks ;
valid
int
marks ;
valid
and different from marks
int
marks ;
valid
and different from marks and marks
int age;
invalid
: due to int
int my_age;
Valid
int _myage;
Valid
but reverse
int 4age;
Invalid
: Due to start with digit
int char;
Invalid
: Due to Keyword ‘char’
int begin;
Invalid
: Due to Pascal Keyword ‘begin’
int my_first_variable;
valid
int My-variable;
Invalid
जब किसी variable name दो या दो से अधिक words को use किया जाता है तब इन words को underscore से differentiate करते है | या सभी words के पहले alphabet को capital मे लिखा जा सकता है |
जैसे :
int my_first_variable;     या  int MyFirstVariable ;
Reading a variable in real world
किसी variable और function के naming हमेशा ही बर्निंग topic होता है क्योकि प्रत्येक प्रोग्रामर के अलग standards होते है | real programming world मे , variable name से पहले ,प्रोग्रामर कुछ character insert जरुर करते है जो की variable से related information को define करते है |उद्धरण के लिए :
integer age को nage से भी named किया जा सकता है जिसमे character ‘n’ age के integer type को define करता है |जिससे किसी प्रोग्रामर को इस variable को identify करना सरल हो जाता है | इसके अलावा कई सारे prefix को use किया जाता है : जैसे :-
1. str और sz : इसका use , null string को represent करने के लिए किया जाता है |
2. b: इसका use, Boolean value के लिए जाता है |
3. p:इसका use, pointer के लिए जाता है |
4. c:इसका use , single character के लिए किया जाता है |
Integer Type
Integer एसे number होते है जिसमे कोई fractional नहीं होता है |उदाहरण के लिए 3,100,-45 और 0 आदि |integer की सख्या असख्य होती है |इसलिए memory मे सभी integer number को represent करने के लिए enough space नहीं होता है |अतः सभी programming language , integer के एक range को define कर सकता है |C++ कई सारे option देता है जिससे integer type को manage किया जा सकता है |
1.c++ integer range मे से कोई भी integer को choose करने के facility देता है |
2.c++ खुद के object को declare करता है |
सभी integer type अलग अलग size की memory को allocate करता है |अतः जब memory space बहुत बड़ा होता है तब ये integer type की बहुत बड़ी range को कवर करता है |integer दोनों positive और negative value को hold कर सकता है |
width of integer का मतलब है integer द्वारा memory मे occupy space |अतः integer के width को निन्म keyword से modify किया जा सकता है :
1.short : width को reduce किया जाता है |
2.long : width को बढाया जाता है |
3.int : width normal होती है |
इसका उदहार है :
#include<iostream.h>
#include<conio.h>
void main()
{
using namespace std ;
int a,b,sum;
cout<<“Your First Number : “<<endl;
cin>>a;
cout<<“Your Second Number : “<<endl;
cin>>b;
sum=a+b;
cout<<“Sum of both numbers : “<<sum<<endl;
getch();
}
इस उदहारण मे तीन variables को declare किया गया जिनका type integer type है |इसका आउटपुट होगा :
Your First Number : 34
Your Second Number : 45
Sum of both numbers : 79
इस article मे variable का basic ,naming और integer type के basic को discuss किया गया है | integer type के prefix और उदाहरानो  को सार मे C++ : Integer Type मे discuss करेगे |
Sbistudy

Recent Posts

four potential in hindi 4-potential electrodynamics चतुर्विम विभव किसे कहते हैं

चतुर्विम विभव (Four-Potential) हम जानते हैं कि एक निर्देश तंत्र में विद्युत क्षेत्र इसके सापेक्ष…

2 days ago

Relativistic Electrodynamics in hindi आपेक्षिकीय विद्युतगतिकी नोट्स क्या है परिभाषा

आपेक्षिकीय विद्युतगतिकी नोट्स क्या है परिभाषा Relativistic Electrodynamics in hindi ? अध्याय : आपेक्षिकीय विद्युतगतिकी…

4 days ago

pair production in hindi formula definition युग्म उत्पादन किसे कहते हैं परिभाषा सूत्र क्या है लिखिए

युग्म उत्पादन किसे कहते हैं परिभाषा सूत्र क्या है लिखिए pair production in hindi formula…

7 days ago

THRESHOLD REACTION ENERGY in hindi देहली अभिक्रिया ऊर्जा किसे कहते हैं सूत्र क्या है परिभाषा

देहली अभिक्रिया ऊर्जा किसे कहते हैं सूत्र क्या है परिभाषा THRESHOLD REACTION ENERGY in hindi…

7 days ago

elastic collision of two particles in hindi definition formula दो कणों की अप्रत्यास्थ टक्कर क्या है

दो कणों की अप्रत्यास्थ टक्कर क्या है elastic collision of two particles in hindi definition…

7 days ago
All Rights ReservedView Non-AMP Version
X

Headline

You can control the ways in which we improve and personalize your experience. Please choose whether you wish to allow the following:

Privacy Settings
JOIN us on
WhatsApp Group Join Now
Telegram Join Join Now