Quiz-1

Q 1. What is the output of this C code? / इस सी कोड का आउटपुट क्या है?
struct p
{
int k;
char c;
};
int p = 10;
int main()
{
struct p x;
x.k = 10;
printf("%d %d\n", x.k, p);
}

  1. Compile time error
  2. 10 10
  3. Depends on the standard
  4. Depends on the compiler

Q 2. Which of the following share a similarity in syntax? /  निम्नलिखित में से कौन वाक्य रचना में समानता साझा करता है?
1. Union, 2. Structure, 3. Arrays and 4. Pointers

  1. 3 and 4
  2. 1 and 2
  3. 1 and 3
  4. 1, 3 and 4

Q 3. What will be output C code ?  / आउटपुट C कोड क्या होगा ?
struct emp
{
int id;
}e;
int main()
{
struct emp *ptr;
ptr=&e;
printf("%d",ptr->id);
return 0;
}

  1. 1
  2. Garbage value
  3. None of these

Q 4. Find Correct Declare & Initialization of the Structure Pointer / संरचना सूचक की सही घोषणा और आरंभीकरण खोजें

  1. *pointer variable name = &structure_variable;
  2. pointer variable name = structure_variable;
  3. *pointer variable name = *structure_variable
  4. pointer variable name = &structure_variable

Q 5. Find Correct Declare a Structure Pointer ? / सही खोजें एक संरचना सूचक घोषित करें?

  1. struct structure_name *ptr;
  2. struct structure_name ptr;
  3. structure_name *ptr;
  4. none of above

Q 6. If a variable is a pointer to a structure, then which of the following operator is used to access data members of the structure through the pointer variable? / यदि एक चर किसी संरचना का सूचक है, तो निम्न में से किस ऑपरेटर का उपयोग सूचक चर के माध्यम से संरचना के डेटा सदस्यों तक पहुँचने के लिए किया जाता है?

  1. .
  2. &
  3. *
  4. ->

Q 7. What is the output of C program? / C प्रोग्राम का आउटपुट क्या है?
int main()
{
struct book
{
int pages;
char name[10];
}a;
a.pages=10;
strcpy(a.name,"Cbasics");
printf("%s=%d", a.name,a.pages);
return 0;
}

  1. empty string=10
  2. C=basics
  3. Cbasics=10
  4. Compiler error

Q 8. What is the size of a C structure? / सी structure का आकार क्या है?

  1. C structure is always 128 bytes.
  2. Size of C structure is the total bytes of all elements of structure.
  3. Size of C structure is the size of largest element.
  4. None of the above

Q 9. Which of the datatypes have size that is variable? / किस डेटाटाइप का आकार परिवर्तनशील होता है?

  1. int
  2. struct
  3. float
  4. double

Q 10. A C structure or User defined datatype is also called ________. / A C संरचना या उपयोगकर्ता परिभाषित डेटाटाइप को ________ भी कहा जाता है।

  1. Derived data type
  2. Secondary data type
  3. Aggregate data type
  4. All the above