पहले 10 प्रश्नों के उत्तर और हल यहीं खुले हैं; बाक़ी 20 के उत्तर और हल FliQi Question Bank app में।
भाषा
प्रश्न 1उत्तर + हल
C प्रोग्रामिंग में float डेटा टाइप की रेंज क्या है?
What is the range of the float data type in C programming?
A0 to 4294967295
B-3.4e38 to +3.4e38
C-1.7e308 to +1.7e308
D-1.7e4932 to +1.7e4932
सही उत्तर / Answer: (B)
हल / Solution
float 4 byte यानी 32 bit में रखा जाता है, जिसमें आठ bit घातांक (exponent) के लिए होते हैं। इसी वजह से उसका मान लगभग -3.4e38 से +3.4e38 तक जा सकता है। पहला विकल्प unsigned long int की पूर्णांक सीमा है। तीसरा विकल्प 8 byte वाले double की सीमा है और चौथा 10 byte वाले long double की। इसलिए float के लिए दूसरा विकल्प ही सही बैठता है।
A float is kept in 4 bytes, that is 32 bits, of which eight bits are given to the exponent. That is why its value can run from about -3.4e38 to +3.4e38. The first option is the integer range of an unsigned long int. The third option is the range of the 8 byte double and the fourth that of the 10 byte long double. So only the second option fits a float.
प्रश्न 2उत्तर + हल
C प्रोग्रामिंग में long double डेटा टाइप की रेंज क्या है?
What is the range of the long double data type in C programming?
A0 to 4294967295
B-3.4e38 to +3.4e38
C-1.7e308 to +1.7e308
D-1.7e4932 to +1.7e4932
सही उत्तर / Answer: (D)
हल / Solution
long double विस्तारित परिशुद्धता (extended precision) वाला प्रकार है और वह 10 byte जगह लेता है। उसका घातांक इतना बड़ा होता है कि सीमा -1.7e4932 से +1.7e4932 तक पहुँच जाती है, यानी तीनों floating प्रकारों में सबसे चौड़ी। पहला विकल्प unsigned long int की पूर्णांक सीमा है, जिसमें दशमलव आता ही नहीं। दूसरा विकल्प float की सीमा है और तीसरा double की, सो वे छोटे प्रकारों के हैं।
long double is the extended precision type and it occupies 10 bytes. Its exponent field is so wide that the range reaches from -1.7e4932 to +1.7e4932, the widest of the three floating types. The first option is the integer range of an unsigned long int, where no decimal part exists at all. The second option is the range of float and the third that of double, so both belong to smaller types.
प्रश्न 3उत्तर + हल
C प्रोग्रामिंग में float कितने byte आरक्षित करता है?
How many byte(s) are reserved by float in C programming?
A2 bytes
B4 bytes
C8 bytes
D10 bytes
सही उत्तर / Answer: (B)
हल / Solution
float एकल परिशुद्धता (single precision) वाला floating point प्रकार है और वह 4 byte यानी 32 bit जगह लेता है। उसी जगह में चिह्न, घातांक और मूल अंक सब समा जाते हैं, और दशमलव के लगभग छह-सात अंक तक भरोसा रहता है। 2 byte short int का माप है। 8 byte double लेता है, जिसकी परिशुद्धता दोगुनी होती है। 10 byte की जगह long double से जुड़ी है, float से नहीं।
float is the single precision floating point type, and it takes 4 bytes, that is 32 bits. The sign, the exponent and the significant digits all fit inside that space, and about six or seven decimal digits stay reliable. 2 bytes is the size of a short int. 8 bytes is taken by double, whose precision is twice as good. The 10 byte figure belongs to long double and not to float at all.
प्रश्न 4उत्तर + हल
C प्रोग्रामिंग में long unsigned int डेटा टाइप की रेंज क्या है?
What is the range of the long unsigned int data type in C programming?
A-32768 to +32767
B0 to 65535
C-2147483648 to +2147483647
D0 to 4294967295
सही उत्तर / Answer: (D)
हल / Solution
unsigned लिखते ही चिह्न वाला bit भी गिनती में शामिल हो जाता है, इसलिए पूरे 32 bit मान के लिए मिलते हैं और कोई ऋणात्मक मान रखा नहीं जा सकता। इससे सीमा 0 से 2^32-1 यानी 0 से 4294967295 तक बनती है। पहला और तीसरा विकल्प ऋणात्मक मान से शुरू होते हैं, सो unsigned के लिए हो ही नहीं सकते। दूसरा विकल्प 2 byte वाले unsigned int की सीमा है।
As soon as unsigned is written, the bit that was kept for the sign joins the count as well, so all 32 bits are available for the value and no negative number can be stored. That makes the range run from 0 to 2^32-1, which is 0 to 4294967295. The first and third options begin with a negative value, so they cannot belong to an unsigned type. The second option is the range of a 2 byte unsigned int.
प्रश्न 5उत्तर + हल
C प्रोग्रामिंग में long signed int डेटा टाइप की रेंज क्या है?
What is the range of the long signed int data type in C programming?
A-32768 to +32767
B0 to 65535
C-2147483648 to +2147483647
D0 to 4294967295
सही उत्तर / Answer: (C)
हल / Solution
long signed int सामान्यतः 4 byte यानी 32 bit जगह लेता है, और signed होने से उसमें ऋणात्मक तथा धनात्मक दोनों मान रखे जाते हैं। एक bit चिह्न के लिए चला जाता है, इसलिए सीमा -2^31 से +2^31-1 तक बनती है, यानी -2147483648 से +2147483647 तक। पहला विकल्प 2 byte वाले int की सीमा है। बाक़ी दो विकल्प शून्य से शुरू होते हैं, सो वे unsigned प्रकारों की सीमाएँ हैं।
A long signed int normally takes 4 bytes, that is 32 bits, and being signed it holds both negative and positive values. One bit goes to the sign, so the range works out from -2^31 up to +2^31-1, which is -2147483648 to +2147483647. The first option is the range of a 2 byte int. The remaining two options start at zero, so they belong to unsigned types and cannot hold negative values.
प्रश्न 6उत्तर + हल
C programming में signed char कितने byte आरक्षित करता है?
How many byte(s) are reserved by signed char in C programming?
A1 byte
B2 bytes
C4 bytes
D8 bytes
सही उत्तर / Answer: (A)
हल / Solution
C standard के अनुसार char, signed char और unsigned char तीनों का आकार हमेशा 1 byte होता है। sizeof(signed char) का मान हर compiler पर 1 ही आता है। आम systems पर 1 byte में 8 bit होती हैं, इसलिए signed char की range −128 से +127 बनती है। 2 byte short का आम आकार है, 4 byte float या 32-bit int का, और 8 byte double का। इनमें से कोई भी char के लिए सही नहीं है।
By the C standard, char, signed char and unsigned char are always exactly 1 byte. sizeof(signed char) gives 1 on every compiler. On common systems 1 byte has 8 bits, so the range of signed char is -128 to +127. 2 bytes is the usual size of short, 4 bytes that of float or a 32-bit int, and 8 bytes that of double. None of these is right for a char.
प्रश्न 7उत्तर + हल
C programming में short unsigned int data type की range क्या है?
What is the range of short unsigned int data type in C programming?
A-128 to + 127
B0 to 255
C-32768 to +32767
D0 to 65535
सही उत्तर / Answer: (D)
हल / Solution
short unsigned int आम compilers में 2 byte यानी 16 bit का होता है। unsigned होने से कोई bit चिह्न के लिए नहीं जाती, इसलिए यह सिर्फ़ शून्य और धनात्मक मान रखता है। इसकी range 0 से 2¹⁶ − 1 होती है, यानी 0 से 65535। −128 से +127 signed char की range है और 0 से 255 unsigned char की। −32768 से +32767 short signed int की range है, जिसमें आधे मान ऋणात्मक होते हैं।
short unsigned int is 2 bytes, that is 16 bits, in common compilers. Being unsigned, no bit is used for the sign, so it holds only zero and positive values. Its range is 0 to 2^16 - 1, that is 0 to 65535. -128 to +127 is the range of signed char and 0 to 255 is that of unsigned char. -32768 to +32767 is the range of short signed int, where half the values are negative.
प्रश्न 8उत्तर + हल
C programming में short signed int data type की range क्या है?
What is the range of short signed int data type in C programming?
A-128 to + 127
B0 to 255
C-32768 to +32767
D0 to 65535
सही उत्तर / Answer: (C)
हल / Solution
short signed int का आकार Turbo C, GCC और Visual Studio जैसे आम compilers में 2 byte यानी 16 bit होता है। एक bit चिह्न के लिए जाती है, इसलिए two's complement में range −2¹⁵ से 2¹⁵ − 1 होती है, यानी −32768 से +32767। −128 से +127 signed char की range है और 0 से 255 unsigned char की। 0 से 65535 unsigned short की range है, जिसमें ऋणात्मक मान नहीं होते।
short signed int is 2 bytes, that is 16 bits, in common compilers like Turbo C, GCC and Visual Studio. One bit is used for the sign, so in two's complement the range is -2^15 to 2^15 - 1, that is -32768 to +32767. -128 to +127 is the range of signed char and 0 to 255 is that of unsigned char. 0 to 65535 is the range of unsigned short, which has no negative values.
प्रश्न 9उत्तर + हल
C programming में unsigned char data type की range क्या है?
What is the range of unsigned char data type in C programming?
A0 to 255
B-128 to +127
C-32768 to +32767
D0 to 65535
सही उत्तर / Answer: (A)
हल / Solution
unsigned char 1 byte यानी 8 bit लेता है। unsigned होने से कोई bit चिह्न के लिए नहीं जाती, इसलिए सारी 8 bit मान रखती हैं। सबसे छोटा मान 0 है और सबसे बड़ा 2⁸ − 1 = 255, यानी range 0 से 255 है। −128 से +127 signed char की range है। −32768 से +32767 और 0 से 65535 दो byte वाले short की signed और unsigned range हैं, जो 1 byte में समा ही नहीं सकतीं।
An unsigned char takes 1 byte, that is 8 bits. Being unsigned, no bit is used for the sign, so all 8 bits hold the value. The smallest value is 0 and the largest is 2^8 - 1 = 255, so the range is 0 to 255. -128 to +127 is the range of signed char. -32768 to +32767 and 0 to 65535 are the signed and unsigned ranges of a 2-byte short, which cannot fit in 1 byte.
प्रश्न 10उत्तर + हल
C programming में signed char data type की range क्या है?
What is the range of signed char data type in C programming?
A0 to 255
B-128 to +127
C-32768 to +32767
D0 to 65535
सही उत्तर / Answer: (B)
हल / Solution
signed char 1 byte यानी 8 bit लेता है। सबसे बाईं bit चिह्न बताती है, और two's complement रूप में range −2⁷ से 2⁷ − 1 होती है, यानी −128 से +127। 0 से 255 unsigned char की range है, जिसमें ऋणात्मक मान नहीं होते। −32768 से +32767 दो byte वाले signed short की range है और 0 से 65535 दो byte वाले unsigned short की। ये 16 bit की range हैं, 8 bit की नहीं।
A signed char takes 1 byte, that is 8 bits. The leftmost bit gives the sign, and in two's complement the range is -2^7 to 2^7 - 1, that is -128 to +127. 0 to 255 is the range of unsigned char, which has no negative values. -32768 to +32767 is the range of a 2-byte signed short, and 0 to 65535 is the range of a 2-byte unsigned short. These are 16-bit ranges, not 8-bit ones.
आगे के 20 प्रश्नों के उत्तर और हल app मेंFliQi Question Bank — अभ्यास, हल और आपकी प्रगति