FliQi Education App Download
प्रश्न-बैंक · C Language

Union in C Language — प्रश्न और उत्तर

C Language · 33 जाँचे हुए (verified) प्रश्न

  • 33 जाँचे हुए प्रश्न
  • हिंदी + English

पहले 10 प्रश्नों के उत्तर और हल यहीं खुले हैं; बाक़ी 20 के उत्तर और हल FliQi Question Bank app में।

भाषा
प्रश्न 1उत्तर + हल
निम्न C कोड का आउटपुट क्या होगा?

#include <stdio.h>

    union p

    {

        int x;

        char y;

    }k = {.y = 97};

    int main()

    {

        printf("%d\n", k.y);

    }
What will be the output of the following C code?

#include <stdio.h>

    union p

    {

        int x;

        char y;

    }k = {.y = 97};

    int main()

    {

        printf("%d\n", k.y);

    }
  1. Aकम्पाइल टाइम एररCompile time error
  2. B97
  3. Ca
  4. Dस्टैण्डर्ड पर निर्भर करता हैDepends on the standard

सही उत्तर / Answer: (B)

हल / Solution
यहाँ नामित आरंभीकरण (designated initializer) का रूप है, जो C99 से वैध है। कोष्ठक में .y लिखने पर यूनियन का सदस्य y चुना जाता है और उसमें सत्तानबे रखा जाता है। y का प्रकार char है, पर printf में %d लगाया गया है, सो मान पूर्णांक की तरह छपता है और 97 दिखता है। अगर वहाँ %c होता तो अक्षर a छपता। इसलिए कम्पाइल टाइम एरर या मानक पर निर्भर वाले विकल्प ग़लत हैं।
This is a designated initializer, a form that has been valid since C99. Writing .y inside the braces selects the member y of the union and stores ninety seven in it. The type of y is char, but printf is given %d, so the value is printed as an integer and 97 appears. Had the specifier been %c, the letter a would have been printed instead. So neither a compile time error nor any dependence on the standard arises.
प्रश्न 2उत्तर + हल
निम्न C कोड का आउटपुट क्या होगा?

#include <stdio.h>

    union p

    {

        int x;

        char y;

    }k = {1, 97};

    int main()

    {

        printf("%d %d", k.x,k.y);

    }
What will be the output of the following C code?

#include <stdio.h>

    union p

    {

        int x;

        char y;

    }k = {1, 97};

    int main()

    {

        printf("%d %d", k.x,k.y);

    }
  1. A1 1
  2. B1 97
  3. C97 97
  4. D97 1

सही उत्तर / Answer: (A)

हल / Solution
यूनियन (union) के सारे सदस्य एक ही मेमोरी साझा करते हैं, इसलिए उसमें एक बार में एक ही मान रह सकता है। यहाँ दो मान दिए गए हैं, जिनमें दूसरा अतिरिक्त है; compiler पहला ही लेता है, सो k.x का मान एक बनता है। फिर k.y उसी जगह का पहला byte पढ़ता है, और little-endian मशीन पर वह भी एक निकलता है। इसलिए 1 1 छपता है। मान 97 कहीं भंडारित ही नहीं हुआ।
All members of a union share the same memory, so it can hold only one value at a time. Two values are supplied here, of which the second is one too many; the compiler keeps the first, so k.x becomes one. Then k.y reads the first byte of that same storage, and on a little endian machine that byte is also one. The output is therefore 1 1, since the value 97 is never stored at all.
प्रश्न 3उत्तर + हल
निम्न C कोड का आउटपुट little-endian मशीन पर क्या होगा?
#include <stdio.h>
union p
{
int x;
char y;
};
int main()
{
union p p;
p.y = 60;
p.x = 12;
printf("%d ", p.y);
printf("%d", p.x);
}
What will be the output of the following C code on a little-endian machine?
#include <stdio.h>
union p
{
int x;
char y;
};
int main()
{
union p p;
p.y = 60;
p.x = 12;
printf("%d ", p.y);
printf("%d", p.x);
}
  1. Aकम्पाइल टाइम एररCompile time error
  2. B60 12
  3. C60 60
  4. D12 12

सही उत्तर / Answer: (D)

हल / Solution
union में x और y एक ही मेमोरी साझा करते हैं। पहले y में साठ रखा, पर अगली पंक्ति में x को बारह करते ही वही बाइट दोबारा लिखे गए, सो y का पुराना मान मिट गया। little-endian मशीन पर int का सबसे नीचा बाइट पहले पड़ता है, और बारह उसी एक बाइट में समा जाता है — इसलिए y पढ़ने पर भी बारह मिलता है। साठ वाले विकल्प तब बनते जब दोनों के अपने खाने होते।
In this union x and y share the same memory. The value sixty goes into y first, but the very next line writes twelve into x and overwrites those same bytes, so the old value of y is gone. On a little-endian machine the lowest byte of the int comes first, and twelve fits inside that single byte, so reading y also gives twelve. The other answers would need separate storage for each member, as a structure gives.
प्रश्न 4उत्तर + हल
निम्न C कोड का आउटपुट क्या होगा?
#include <stdio.h>
union
{
int x;
char y;
}p;
int main()
{
p.x = 10;
printf("%d\n", sizeof(p));
}
What will be the output of the following C code?
#include <stdio.h>
union
{
int x;
char y;
}p;
int main()
{
p.x = 10;
printf("%d\n", sizeof(p));
}
  1. Aकम्पाइल टाइम एररCompile time error
  2. Bsizeof(int) + sizeof(char)
  3. Cकंपाइलर पर निर्भर करता हैDepends on the compiler
  4. Dsizeof(int)

सही उत्तर / Answer: (D)

हल / Solution
union के सारे सदस्य एक ही मेमोरी खाना साझा करते हैं, सो उसका आकार सबसे बड़े सदस्य के बराबर होता है। यहाँ int और char में बड़ा int है, इसलिए sizeof(p) हर compiler पर sizeof(int) ही रहता है। वह संख्या मशीन से बदल सकती है, पर विकल्प संख्या नहीं बता रहे, सूत्र बता रहे हैं — इसीलिए «कंपाइलर पर निर्भर» ग़लत है। दोनों का जोड़ structure का नियम है, और कोड सही है सो कम्पाइल एरर भी नहीं आता।
Every member of a union shares the same block of memory, so the union is as large as its biggest member. Between an int and a char the int is bigger, so sizeof(p) equals sizeof(int) on every compiler. The printed number may differ from machine to machine, but the options give formulas rather than numbers, so saying it depends on the compiler is wrong. Adding the two sizes is a structure rule, and the code itself compiles cleanly.
प्रश्न 5उत्तर + हल
निम्न C कोड का आउटपुट क्या होगा?

#include <stdio.h>

    union stu

    {

        int ival;

        float fval;

    };

    void main()

    {

        union stu r;

        r.ival = 5;

        printf("%d", r.ival);

    }
What will be the output of the following C code?

#include <stdio.h>

    union stu

    {

        int ival;

        float fval;

    };

    void main()

    {

        union stu r;

        r.ival = 5;

        printf("%d", r.ival);

    }
  1. A9
  2. Bकम्पाइल टाइम एररCompile time error
  3. C16
  4. D5

सही उत्तर / Answer: (D)

हल / Solution
यूनियन stu का वेरिएबल r बनाया गया। r.ival = 5 से ival में 5 रखा गया। उसके बाद उसी सदस्य r.ival को %d से छापा गया। जो सदस्य लिखा गया वही पढ़ा गया, इसलिए मान पक्का 5 है। fval को छुआ ही नहीं गया, इसलिए साझा मेमोरी से कोई गड़बड़ नहीं होती। कोड सही है, इसलिए compile error नहीं है। 9 और 16 का कोई आधार नहीं है।
A variable r of type union stu is created. r.ival = 5 stores 5 in ival. Then the same member r.ival is printed with %d. The member that was written is the one that is read, so the value is surely 5. fval is never touched, so the shared memory causes no problem here. The code is valid, so there is no compile time error. The values 9 and 16 have no basis.
प्रश्न 6उत्तर + हल
निम्न C कोड में वेरिएबल u किस प्रकार का डेटा रख सकता है?

#include <stdio.h>

    union u_tag

    {

        int ival;

        float fval;

        char *sval;

    } u;
What type of data is held by the variable u in the following C code?

#include <stdio.h>

    union u_tag

    {

        int ival;

        float fval;

        char *sval;

    } u;
  1. Aतीनों types में से सबसे बड़े को रख सकने लायक़ बड़ा होगाWill be large enough to hold the largest of the three types;
  2. Bतीनों types में से सबसे छोटे को रख सकने लायक़ बड़ा होगाWill be large enough to hold the smallest of the three types;
  3. Cतीनों types को एक साथ रख सकने लायक़ बड़ा होगाWill be large enough to hold the all of the three types;
  4. Dउल्लिखित में से कोई नहींNone of the mentioned

सही उत्तर / Answer: (A)

हल / Solution
यूनियन के तीनों सदस्य ival, fval और sval एक ही मेमोरी साझा करते हैं। इसलिए compiler यूनियन u को इतनी जगह देता है कि तीनों में से सबसे बड़ा type उसमें समा जाए। एक समय पर उसमें इन तीनों में से कोई एक ही मान रहता है। सबसे छोटे जितनी जगह में बड़ा type नहीं समाएगा। तीनों को एक साथ रखने की जगह स्ट्रक्चर देता है, यूनियन नहीं। इसलिए पहला विकल्प सही है।
The three members ival, fval and sval share the same memory. So the compiler gives the union u enough space to hold the largest of the three types. At any moment it holds only one of these values. Space for only the smallest type would not fit the larger ones. Room for all three together is what a structure provides, not a union. So the first option is correct, as K&R also states.
प्रश्न 7उत्तर + हल
निम्नलिखित C कोड में REF LINE के बाद यूनियन का कौन-सा सदस्य सक्रिय होगा?
#include <stdio.h>
union temp
{
int a;
float b;
char c;
};
union temp s = {1, 2.5, 'A'}; //REF LINE
Which member of the union will be active after REF LINE in the following C code?
#include <stdio.h>
union temp
{
int a;
float b;
char c;
};
union temp s = {1, 2.5, 'A'}; //REF LINE
  1. Aa
  2. Bb
  3. Cc
  4. Dतीनों सदस्य एक साथAll three members at the same time

सही उत्तर / Answer: (A)

हल / Solution
union में एक समय पर एक ही सदस्य ज़िंदा रहता है। कोष्ठक वाला initializer union के सिर्फ़ पहले सदस्य को मान देता है — यहाँ a को एक मिला, और 2.5 तथा 'A' अतिरिक्त initializer हैं जिन्हें compiler छोड़ देता है। इसलिए REF LINE के बाद सक्रिय सदस्य a है। b या c में मान रखने के लिए s.b या s.c पर अलग assignment करना पड़ता। तीनों सदस्य एक साथ सक्रिय होना union में संभव ही नहीं।
Only one member of a union is alive at a time, because they all share the same memory. A braced initializer gives a value to the first member only, so here a receives one, while 2.5 and 'A' are excess initializers that the compiler drops. The active member after REF LINE is therefore a. Putting a value into b or c would need a separate assignment to s.b or s.c. Having all three active together is impossible in a union.
प्रश्न 8उत्तर + हल
इस प्रोग्राम का आउटपुट क्या है?

#include <stdio.h>

int main()

{

    union demo {

        int x;

        int y;

    };

    union demo a = 100;

    printf("%d %d",a.x,a.y);

}
What is the output of this program?

#include <stdio.h>

int main()

{

    union demo {

        int x;

        int y;

    };

    union demo a = 100;

    printf("%d %d",a.x,a.y);

}
  1. A100 0
  2. B100 100
  3. C0 0
  4. Dकम्पाइलेशन एररCompilation Error

सही उत्तर / Answer: (D)

हल / Solution
यूनियन वेरिएबल को initialize करने के लिए braces वाली सूची चाहिए, जैसे union demo a = {100}; या फिर उसी प्रकार का कोई दूसरा यूनियन। यहाँ union demo a = 100; में सीधे एक int दिया गया है। int और union demo अलग प्रकार हैं, इसलिए compiler यहाँ error देता है (invalid initializer)। प्रोग्राम compile ही नहीं होता, तो कोई आउटपुट नहीं छपता। अगर {100} लिखा होता तो x और y एक ही मेमोरी साझा करने से 100 100 छपता।
A union variable must be initialized with a brace-enclosed list, such as union demo a = {100};, or with another union of the same type. Here union demo a = 100; gives a plain int. An int and union demo are different types, so the compiler reports an error (invalid initializer). The program does not compile, so nothing is printed. With {100}, x and y would share the same memory and print 100 100.
प्रश्न 9उत्तर + हल
यूनियन के सदस्य ________ के रूप में एक्सेस किए जाते हैं।
Members of a union are accessed as ________.
  1. Aयूनियन-वेरिएबल.मेंबरunion-variable.member
  2. Bयूनियन-पॉइंटर->मेंबरunion-pointer->member
  3. Ca और b दोनोंBoth a & b
  4. Dउल्लिखित में से कोई नहींNone of the mentioned

सही उत्तर / Answer: (C)

हल / Solution
यूनियन के सदस्य तक दो तरह से पहुँचा जाता है। अगर हमारे पास यूनियन का वेरिएबल है तो dot ऑपरेटर लगता है, जैसे u.member। अगर यूनियन का पॉइंटर है तो arrow ऑपरेटर लगता है, जैसे p->member। p->member असल में (*p).member का छोटा रूप है। दोनों तरीक़े सही और आम हैं, इसलिए उत्तर a और b दोनों है। "कोई नहीं" ग़लत है क्योंकि दोनों तरीक़े मान्य हैं।
A union member can be reached in two ways. With a union variable, we use the dot operator, as in u.member. With a pointer to a union, we use the arrow operator, as in p->member. In fact, p->member is just a short form of (*p).member. Both ways are correct and common, so the answer is both a and b. "None of the mentioned" is wrong because both forms are valid.
प्रश्न 10उत्तर + हल
यूनियन का वर्णन करने के लिए सबसे उपयुक्त वाक्य कौन-सा है?
Most appropriate sentence to describe union is:
  1. Aयूनियन स्ट्रक्चर जैसे होते हैंUnions are like structures
  2. Bयूनियन में अलग-अलग प्रकार के सदस्य होते हैं, जो मेमोरी में एक ही स्थान साझा करते हैंUnion contain members of different types which share the same storage area in memory
  3. Cप्रोग्राम में यूनियन का उपयोग कम होता हैUnion less Frequently used in the program
  4. Dयूनियन का उपयोग set operations के लिए होता हैUnion are used for set operations

सही उत्तर / Answer: (B)

हल / Solution
यूनियन की असली पहचान यह है कि उसके अलग-अलग प्रकार के सदस्य मेमोरी का एक ही हिस्सा साझा करते हैं। यही बात उसे स्ट्रक्चर से अलग करती है। "स्ट्रक्चर जैसे होते हैं" सिर्फ़ लिखने के ढंग की समानता बताता है, यूनियन का काम नहीं। कम उपयोग होना कोई परिभाषा नहीं है। set operations से C के यूनियन का कोई संबंध नहीं, वह गणित वाले union से अलग है। इसलिए दूसरा वाक्य सबसे उपयुक्त है।
The defining feature of a union is that its members, which may be of different types, share the same area of memory. That is exactly what separates it from a structure. "Unions are like structures" only points to similar syntax, not to how a union works. Being used less often is not a definition. A C union has nothing to do with set operations; it is not the union of sets in maths. So option 2 fits best.
आगे के 20 प्रश्नों के उत्तर और हल app मेंFliQi Question Bank — अभ्यास, हल और आपकी प्रगति
App खोलिए
प्रश्न 14उत्तर app में
निम्नलिखित घोषणा का आकार क्या होगा? (मान लीजिए double का आकार 8, int का आकार 4 और char का आकार 1 है)
union uTemp
{
double a;
int b[10];
char c;
} u;
What would be the size of the following declaration? (Assuming size of double = 8, size of int = 4, size of char = 1)
union uTemp
{
double a;
int b[10];
char c;
} u;
  1. A4
  2. B8
  3. C40
  4. D80
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 15उत्तर app में
यूनियन के तत्वों (सदस्यों) को हमेशा & ऑपरेटर का उपयोग करके एक्सेस किया जाता है।
The elements of union are always accessed using & operator.
  1. AहाँYES
  2. BनहींNO
  3. CशायदMay be
  4. Dकोई नहींNone
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 16उत्तर app में
padding और alignment को छोड़ दें, तो संघ (union) का आकार उसके सबसे बड़े सदस्य के आकार के बराबर होता है — क्या यह कथन सही है?
Ignoring padding and alignment, the size of a union is the size of its longest member. Is this statement correct?
  1. AहाँYes
  2. BनहींNo
  3. Cहो सकता हैMay Be
  4. Dनहीं कह सकतेCan't Say
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 17उत्तर app में
C प्रोग्राम का आउटपुट क्या है?

int main()

{

union ship

{

int size;

char color[10];

}boat1, boat2;

boat1.size=10;

boat2 = boat1;

printf("boat2=%d",boat2.size);

return 0;

}
What is the output of the C program?

int main()

{

union ship

{

int size;

char color[10];

}boat1, boat2;

boat1.size=10;

boat2 = boat1;

printf("boat2=%d",boat2.size);

return 0;

}
  1. Aboat2=0
  2. Bboat2=-1
  3. Cboat2=10
  4. Dकम्पाइलर एररCompiler error
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 18उत्तर app में
निम्नलिखित C कोड का आउटपुट क्या होगा (मान लीजिए int और float का आकार 4 है)?

union

{

int ival;

float fval;

} u;

void main()

{

printf("%d", sizeof(u));

}
What will be the output of the following C code (Assuming size of int and float is 4)?

union

{

int ival;

float fval;

} u;

void main()

{

printf("%d", sizeof(u));

}
  1. A16
  2. B8
  3. C4
  4. D32
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 19उत्तर app में
निम्नलिखित C कोड का आउटपुट क्या होगा?

union emp

{

int code;

}e;

int main()

{

union emp *ptr;

e.code=65;

ptr=&e;

printf("%c",ptr->code);

return 0;

}
What will be the output of the following C code?

union emp

{

int code;

}e;

int main()

{

union emp *ptr;

e.code=65;

ptr=&e;

printf("%c",ptr->code);

return 0;

}
  1. A65
  2. BA
  3. CGarbage value (कचरा मान)Garbage value
  4. Dइनमें से कोई नहींNone of these
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 20उत्तर app में
Union सूचक (union pointer) की सही घोषणा और आरंभीकरण कौन-सा है?
Find the correct declaration and initialization of a union pointer-
  1. A*pointer variable name = &union_variable;
  2. Bpointer variable name = union_variable;
  3. C*pointer variable name = *union_variable
  4. Dpointer variable name = &union_variable
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 22उत्तर app में
किसी यूनियन का आकार __________ के आकार से तय होता है।
The size of a union is determined by the size of the __________
  1. Aयूनियन का पहला सदस्यFirst member in the union
  2. Bयूनियन का आख़िरी सदस्यLast member in the union
  3. Cयूनियन का सबसे बड़ा सदस्यBiggest member in the union
  4. Dसभी सदस्यों के आकार का जोड़Sum of the sizes of all members
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 23उत्तर app में
यूनियन, स्ट्रक्चर से किस प्रकार भिन्न है?
Union differs from structure in the following way
  1. Aएक समय में सभी सदस्यों का उपयोग होता हैAll members are used at a time
  2. Bएक समय में केवल एक सदस्य का उपयोग किया जा सकता हैOnly one member can be used at a time
  3. Cयूनियन में ज़्यादा सदस्य नहीं हो सकतेUnion cannot have more members
  4. Dयूनियन स्ट्रक्चर की तरह सभी सदस्यों को initialize करता हैUnion initialized all members as structure
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 24उत्तर app में
union test

{

int x;

char arr[4];

int y;

};

int main()

{

union test t;

t.x = 0;

t.arr[1] = 'G';

printf("%s", t.arr);

return 0;

}

ऊपर दिए प्रोग्राम का आउटपुट बताइए। मान लीजिए int का आकार 4 बाइट और char का आकार 1 बाइट है। यह भी मान लीजिए कि कोई alignment ज़रूरी नहीं है।
union test

{

int x;

char arr[4];

int y;

};

int main()

{

union test t;

t.x = 0;

t.arr[1] = 'G';

printf("%s", t.arr);

return 0;

}

Predict the output of above program. Assume that the size of an integer is 4 bytes and size of character is 1 byte. Also assume that there is no alignment needed.
  1. Aकुछ भी प्रिंट नहीं होताNothing is printed
  2. Bएक garbage अक्षर और उसके बाद 'G'Garbage character followed by 'G'
  3. Cएक garbage अक्षर, फिर 'G', फिर और garbage अक्षरGarbage character followed by 'G', followed by more garbage characters
  4. DCompiler Error
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 25उत्तर app में
जब एक स्ट्रक्चर और एक यूनियन में सदस्य एक जैसे हों, तब C में इनमें से कौन-सी स्थिति कभी संभव नहीं है?

मान लीजिए P एक स्ट्रक्चर है

मान लीजिए Q एक यूनियन है
Which among the following is never possible in C when members in a structure are same as that in a union?

Let P be a structure

Let Q be a union
  1. Asizeof(P), sizeof(Q) से बड़ा हैsizeof(P) is greater than sizeof(Q)
  2. Bsizeof(P), sizeof(Q) के बराबर हैsizeof(P) is equal to sizeof(Q)
  3. Csizeof(P), sizeof(Q) से छोटा हैsizeof(P) is less than to sizeof(Q)
  4. Dउपरोक्त में से कोई नहींNone of the above
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 26उत्तर app में
स्ट्रक्चर, यूनियन और enumeration (गणना) में क्या समानता है?
What is the similarity between a structure, union and enumeration?
  1. Aतीनों से नए मान (values) परिभाषित किए जा सकते हैंAll of them let you define new values
  2. Bतीनों से नए data type परिभाषित किए जा सकते हैंAll of them let you define new data types
  3. Cतीनों से नए pointer परिभाषित किए जा सकते हैंAll of them let you define new pointers
  4. Dतीनों से नए स्ट्रक्चर परिभाषित किए जा सकते हैंAll of them let you define new structures
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 27उत्तर app में
निम्नलिखित C घोषणा पर विचार कीजिए:

struct {

    short s[5];

    union {

         float y;

         long z;

    }u;

} t;

मान लीजिए short, float और long प्रकार के ऑब्जेक्ट क्रमशः 2 बाइट, 4 बाइट और 8 बाइट लेते हैं। alignment को अनदेखा करते हुए वेरिएबल t के लिए कितनी मेमोरी चाहिए? (GATE CS 2000)
Consider the following C declaration:

struct {

    short s[5];

    union {

         float y;

         long z;

    }u;

} t;

Assume that objects of the type short, float and long occupy 2 bytes, 4 bytes and 8 bytes, respectively. The memory requirement for variable t, ignoring alignment considerations, is (GATE CS 2000)
  1. A22 बाइट22 bytes
  2. B14 बाइट14 bytes
  3. C18 बाइट18 bytes
  4. D10 बाइट10 bytes
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 28उत्तर app में
struct emp का sizeof क्या है (16 बिट मशीन पर, और मान लीजिए कि padding नहीं लगती यानी byte packing है)?
struct emp
{
int x;
union emp1
{
char p;
}r1;
}r2;
What is sizeof struct emp (according to a 16 bit machine, assuming byte packing with no padding)?
struct emp
{
int x;
union emp1
{
char p;
}r1;
}r2;
  1. A2
  2. B3
  3. C0
  4. DError
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 30उत्तर app में
निम्नलिखित C कोड (64 बिट मशीन पर) का आउटपुट क्या है?
union Sti
{
int nu;
char m;
};
int main()
{
union Sti s;
printf("%d", sizeof(s));
return 0;
}
What is the output of the following C code (on a 64 bit machine)?
union Sti
{
int nu;
char m;
};
int main()
{
union Sti s;
printf("%d", sizeof(s));
return 0;
}
  1. A8
  2. B5
  3. C9
  4. D4
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
Union in C Language के सभी 33 प्रश्न — उत्तर, हल और अभ्यास

FliQi Question Bank app में topic-वार अभ्यास, कठिनाई-स्तर और आपकी प्रगति।

  • पहला test मुफ़्त
  • हिंदी + English
  • जाँचे हुए उत्तर और हल

यह topic किन परीक्षाओं में आता है

C Language के दूसरे topics

सभी topics