🎧 New: AI-Generated Podcasts Turn your study notes into engaging audio conversations. Learn more

C भाषा: डेटा प्रकार
9 Questions
4 Views

C भाषा: डेटा प्रकार

Created by
@ParamountIllumination3795

Podcast Beta

Play an AI-generated podcast conversation about this lesson

Questions and Answers

C भाषा में 'int' डेटा प्रकार का आकार सामान्यतः कितना होता है?

  • 4 बाइट (correct)
  • 2 बाइट
  • 8 बाइट
  • 1 बाइट
  • 'char' डेटा प्रकार में कौन सी विशेषता है?

  • यह एकल वर्णों का प्रतिनिधित्व करता है (correct)
  • यह केवल सकारात्मक संख्याएँ रखता है
  • यह हर किसी आकार का हो सकता है
  • यह फ्लोटिंग पॉइंट नंबरों का प्रतिनिधित्व करता है
  • C में 'float' डेटा प्रकार का उपयोग किस प्रकार करता है?

  • सिंगल प्रिसिजन फ्लोटिंग प्वाइंट नंबरों के लिए (correct)
  • कोई मान रखने के लिए नहीं
  • केवल पूर्णांक मान देने के लिए
  • ध्रुवीय मान दर्शाने के लिए
  • C में 'struct' का उपयोग किस प्रकार किया जाता है?

    <p>विभिन्न प्रकारों के चर को समूहित करने के लिए</p> Signup and view all the answers

    कौन सा डेटा प्रकार एक निश्चित संख्यात्मक मानों का सेट प्रदर्शित करता है?

    <p>enum</p> Signup and view all the answers

    'unsigned' प्रकार के डेटा का क्या अर्थ है?

    <p>यह केवल सकारात्मक मान रख सकता है</p> Signup and view all the answers

    C भाषा में 'union' डेटा प्रकार का सबसे बड़ा लाभ क्या है?

    <p>सभी सदस्य एक ही मेमोरी स्थान साझ करते हैं</p> Signup and view all the answers

    C में 'sizeof()' फंक्शन का उपयोग किसके लिए किया जाता है?

    <p>डेटा प्रकार के आकार को ज्ञात करने के लिए</p> Signup and view all the answers

    C में डेटा प्रकारों के बीच कौन-सी प्रकार की रूपांतरण होती है?

    <p>सिद्धांत रूपांतरण और स्पष्ट रूपांतरण</p> Signup and view all the answers

    Study Notes

    C Language: Data Types

    • Definition: Data types in C define the type of data a variable can hold, determining the operations that can be performed on it, the amount of space it occupies in memory, and its representation.

    • Basic Data Types:

      1. int:

        • Represents integer values.
        • Typically 4 bytes (32 bits) on most systems.
        • Can be signed (default) or unsigned.
      2. char:

        • Represents single characters.
        • Usually 1 byte (8 bits).
        • Can also be signed or unsigned.
      3. float:

        • Represents single-precision floating point numbers.
        • Usually 4 bytes (32 bits).
      4. double:

        • Represents double-precision floating point numbers.
        • Usually 8 bytes (64 bits).
      5. void:

        • Represents the absence of type.
        • Used for functions that do not return a value.
    • Derived Data Types:

      1. Arrays:

        • Collection of elements of the same type.
        • Syntax: data_type array_name[size];
      2. Pointers:

        • Variables that store memory addresses of other variables.
        • Syntax: data_type *pointer_name;
      3. Structures:

        • User-defined data types that group variables of different types.
        • Syntax:
          struct structure_name {
              data_type member1;
              data_type member2;
              ...
          };
          
      4. Unions:

        • Similar to structures, but members share the same memory location.
        • Syntax:
          union union_name {
              data_type member1;
              data_type member2;
              ...
          };
          
      5. Enumerations (enum):

        • User-defined type consisting of a set of named integer constants.
        • Syntax:
          enum enum_name { constant1, constant2, ... };
          
    • Type Modifiers:

      • signed: Can hold both negative and positive values.
      • unsigned: Can only hold positive values.
      • short: Indicates a smaller range than normal (usually 2 bytes).
      • long: Indicates a larger range than normal (usually 4 or 8 bytes).
    • Type Size:

      • Sizes can vary based on system architecture.
      • Use sizeof(data_type) to determine the size of a specific data type in bytes at runtime.
    • Type Conversion:

      • Implicit and explicit conversions can occur between types.
      • Example of explicit conversion: (float) int_variable.

    Understanding these data types is crucial for effective programming in C, as they impact memory usage and performance.

    C भाषा: डेटा प्रकार

    • डेटा प्रकार C में यह निर्धारित करते हैं कि एक चर में कौन सा डेटा हो सकता है, किस प्रकार के ऑपरेशन्स किए जा सकते हैं, यह मेमोरी में कितना स्थान रखता है, और इसकी प्रस्तुति क्या होगी।

    • बेसिक डेटा प्रकार:

      • int: पूर्णांक मान का प्रतिनिधित्व करता है। आमतौर पर 4 बाइट (32 बिट) का होता है। साइनड (डिफ़ॉल्ट) या अनसाइनड हो सकता है।
      • char: एकल पात्रों का प्रतिनिधित्व करता है। आमतौर पर 1 बाइट (8 बिट) का होता है। साइनड या अनसाइनड हो सकता है।
      • float: एकल-प्रिसिजन फ्लोटिंग-पॉइंट नंबर का प्रतिनिधित्व करता है। आमतौर पर 4 बाइट (32 बिट) का होता है।
      • double: डबल-प्रिसिजन फ्लोटिंग-पॉइंट नंबर का प्रतिनिधित्व करता है। आमतौर पर 8 बाइट (64 बिट) का होता है।
      • void: टाइप की अनुपस्थिति को दर्शाता है। उन फंक्शन्स के लिए उपयोग किया जाता है जो कोई मान नहीं लौटाते।
    • व्युत्पन्न डेटा प्रकार:

      • Arrays: समान प्रकार के तत्वों का संग्रह। सिंटेक्स: data_type array_name[size];
      • Pointers: अन्य चर के मेमोरी पते को संग्रहीत करने वाले चर। सिंटेक्स: data_type *pointer_name;
      • Structures: उपयोगकर्ता-परिभाषित डेटा प्रकार जो विभिन्न प्रकार के चरों को समूहित करते हैं। सिंटेक्स:
        struct structure_name {
            data_type member1;
            data_type member2;...};
        
      • Unions: संरचनाओं के समान, लेकिन सदस्यों के पास एक ही मेमोरी स्थान साझा होता है। सिंटेक्स:
        union union_name {
            data_type member1;
            data_type member2;...};
        
      • Enumerations (enum): उपयोगकर्ता-परिभाषित प्रकार जिसमें नामित पूर्णांक स्थिरांक का सेट होता है। सिंटेक्स:
        enum enum_name { constant1, constant2,...};
        
    • टाइप मोडिफायर:

      • signed: नकारात्मक और सकारात्मक दोनों मान धारित कर सकता है।
      • unsigned: केवल सकारात्मक मान धारित कर सकता है।
      • short: सामान्य से छोटे सीमा को इंगित करता है (आमतौर पर 2 बाइट)।
      • long: सामान्य से बड़े सीमा को इंगित करता है (आमतौर पर 4 या 8 बाइट)।
    • टाइप आकार:

      • आकार प्रणाली आर्किटेक्चर के आधार पर भिन्न हो सकते हैं। किसी विशिष्ट डेटा प्रकार का आकार ज्ञात करने के लिए sizeof(data_type) का उपयोग करें।
    • टाइप रूपांतरण:

      • प्रकारों के बीच अप्रत्यक्ष और प्रत्यक्ष रूपांतरण हो सकता है। प्रत्यक्ष रूपांतरण का उदाहरण: (float) int_variable
    • C में डेटा प्रकारों को समझना महत्वपूर्ण है क्योंकि ये मेमोरी उपयोग और प्रदर्शन को प्रभावित करते हैं।

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Description

    इस प्रश्नोत्तरी में C भाषा के डेटा प्रकारों के बारे में जानें। विभिन्न डेटा प्रकार जैसे int, char, float, double और void के विवरण के साथ ही उनके उपयोगों और विशेषताओं पर ध्यान केंद्रित किया गया है। यह क्विज़ आपको डेटा प्रकारों की गहराई से समझने में मदद करेगा।

    More Quizzes Like This

    Use Quizgecko on...
    Browser
    Browser