हिंदी माध्यम नोट्स
Operator advance in c language in hindi c कंप्यूटर भाषा में ऑपरेटर अडवांस लेवल
Type casting C language की वो technique है जिसमे C कोम्प्लिएर किसी data type को दुसरे data type मई ऑटो माटिक change कर देता है | ये दो प्रकार के होती है :-
IMPLICIT TYPE CASTING :
जब C COMPILER, AUTOMATIC किसी DATA TYPE को किसी दुसरे data TYPE मई CHANGE कर देता है तब उसे IMPLICIT TYPE CASTING कहते है |EXPRESSION को CALCULATE सरलता से कैलकुलेट करने के लिए ,C COMPILER इस TYPE CASTING कोइस्तेमल करता है |
इस TYPE CASTING मे कुछ RULES FOLLOW होते है |जो निम्न है :-
1.जब किसी expression मे दो अलग -अलग type के Oprand use होते है तब LOWER TYPE आटोमेटिक HIGHER TYPE मे CONVERT हो जाता है |और expression का आउटपुट भी HIGHER TYPE मे होता है |
2. Character और Short data type हमेशा integer मे CONVERT हो जाता है |
3.अगर किसी expression मे long double data type होता है तब बाकि के datatype आटोमेटिक long double मे CONVERT हो जाता है | RESULT भी long double मे मिलता है |
4.अगर किसी expression मे operands long integer और unsigned long integer होते है तब unsigned integer, long integer मे कन्वर्ट हो जाता है और expression का आउटपुट भी long integer मे मिलता है|
नीचे दिए गये डायग्राम मे TYPE CONVERSION के क्रम को बताया गया है जिसे C COMPLIER FOLLOW करता है |
EXPLICIT TYPE CASTING :
जब प्रोग्रामर द्वारा किसी operand के data type को दुसरे data type मे CONVERT करता है तब इसे EXPLICIT TYPE CASTING कहते है |इसका syntax नीचे है :-
(TYPE CASTING DATA TYPE) EXPRSSION ;
यह पर TYPE CASTING DATA TYPE का मतलब यूजर द्वारा DESIRED DATA TYPE है |
EXAMPLE:
#include<conio.h>
void main ()
{
int a,b,c;
printf(“Enter your input = “)
scanf(“%d”,&a);
printf(“Enter your input = “);
scanf(“%d”,&b);
(float)c=a/b;
printf(“Your output = %f”, c);
}
यह पर a/b का आउटपुट float datatype मे आयगा इसलिए प्रोग्रामर ने explicit type casting से integer c को float c मे convert कर दिया है |
आउटपुट होगा :
Enter your input = 23
Enter your input = 25
Your output = 0.92
Recent Posts
Question Tag Definition in english with examples upsc ssc ias state pcs exames important topic
Question Tag Definition • A question tag is a small question at the end of a…
Translation in english grammer in hindi examples Step of Translation (अनुवाद के चरण)
Translation 1. Step of Translation (अनुवाद के चरण) • मूल वाक्य का पता करना और उसकी…
Report Writing examples in english grammer How to Write Reports explain Exercise
Report Writing • How to Write Reports • Just as no definite rules can be laid down…
Letter writing ,types and their examples in english grammer upsc state pcs class 12 10th
Letter writing • Introduction • Letter writing is an intricate task as it demands meticulous attention, still…
विश्व के महाद्वीप की भौगोलिक विशेषताएँ continents of the world and their countries in hindi features
continents of the world and their countries in hindi features विश्व के महाद्वीप की भौगोलिक…
भारत के वन्य जीव राष्ट्रीय उद्यान list in hin hindi IAS UPSC
भारत के वन्य जीव भारत में जलवायु की दृष्टि से काफी विविधता पाई जाती है,…