MCQ on Structures in C — 40 Questions with Answers
  • Twitter
  • Facebook
  • Snapchat
  • Instagram

MCQ, Multiple Choice Questions on Structures in C

📑 On this page:
  • Structure Basics
  • Members & Access
  • sizeof, Padding & Alignment
  • Unions
  • Structures vs Unions
  • Pointers to Structures
  • Structures & Functions
  • Advanced Topics
  • Frequently Asked Questions
MCQ on structures in C including declaration, initialization, sizeof, padding, pointers to structures, and unions
MCQ on structures in C — practice set with answers and simple explanations.
📚 In this quiz, you will revise:
  • How to declare, initialize, and access structures
  • The dot operator vs the arrow operator
  • Nested structures and arrays of structures
  • Why sizeof(struct) is bigger than the sum of its members
  • How unions differ from structures and when to use them
  • Passing structures to functions by value and by pointer
  • typedef, self-referential structs, and bit-fields
  • Common interview questions about padding and comparison

This page has 40 multiple choice questions on structures and unions in C. You'll find questions on declaration, initialization, sizeof, memory padding, pointers to structs, typedef, nested structures, self-referential structs, and the difference between structs and unions. Each question comes with the correct answer and a short explanation in plain English, so you understand the "why" and not just the "what". These MCQs are useful for beginners preparing for college exams, interviews, or any C programming test — structures are heavily tested in both.

Structure Basics

Q1. Which keyword is used to declare a structure in C?

  • a) struct
  • b) typedef
  • c) union
  • d) structdef

Answer: a) struct

The struct keyword introduces a structure definition: struct Point { int x; int y; };. typedef is used to create an alias, union creates a union (different thing), and structdef doesn't exist in C. The struct keyword is one of the most important in the language — you'll use it constantly when organizing complex data.

Q2. How is a structure variable declared in C?

  • a) struct tag varname;
  • b) struct varname = { };
  • c) struct varname { };
  • d) struct varname ();

Answer: a) struct tag varname;

To declare a structure variable, you need the struct keyword, the structure tag (the name of the struct type), and the variable name: struct Point p;. Option C defines a new struct type, not a variable. Option D is not valid syntax. Option B looks like initialization, but you can't leave the tag off and give braces with nothing inside.

Q3. What is the main purpose of using structures in C programs?

  • a) To organize related data types together
  • b) To define functions with multiple return values
  • c) To declare global variables
  • d) To create constants

Answer: a) To organize related data types together

A struct groups different types into one logical unit. For example, a Student struct might hold an int rollno, a char name[20], and a float marks — all related data in one place. This is the entire point of structures: data organization. To return multiple values from a function, you can return a struct (that's one use case), but the primary purpose is grouping related data.

Q4. Can a structure contain another structure as a member in C?

  • a) Yes
  • b) No

Answer: a) Yes

Nested structures are completely legal in C. For example: struct Address { char city[30]; }; struct Person { char name[20]; struct Address addr; };. You access nested members with chained dots: p.addr.city. This allows you to build complex data hierarchies — a key concept for real-world C applications.

Q5. Which of the following is NOT a valid member of a structure in C?

  • a) Functions
  • b) Arrays
  • c) Pointers
  • d) Structures

Answer: a) Functions

In C, struct members must be data, not code. Arrays, pointers, and other structs are all valid members. You cannot put a function definition inside a struct — that's a C++ feature, not C. You can, however, put a function pointer inside a struct: void (*callback)(void); — that's data (a pointer), not a function body, so it's allowed. The question specifically asks about "a function", so A is the answer.

Q6. Can a structure member have the same name as the structure tag itself in C?

  • a) Yes
  • b) No

Answer: a) Yes

C allows a struct member to share a name with its own struct tag because they live in different namespaces. For example: struct Student { int Student; }; compiles fine. However, this is confusing and rarely a good idea. The original question had "Answer: b) Yes" which is contradictory — the correct answer is a) Yes.

Q7. What is the scope of a structure tag defined at file level?

  • a) Only inside the function where it is defined
  • b) The entire file, from the point of definition to the end
  • c) Only inside the block where it is defined
  • d) The entire program regardless of files

Answer: b) The entire file, from the point of definition to the end

A struct tag has file scope (also called "tag scope") — it's visible from where you define it to the end of the translation unit. Unlike functions, struct tags don't have external linkage. To make a struct type usable in another file, you typically put the definition in a header and include that header everywhere.

Q8. When is memory allocated for structure members in C?

  • a) At compile time only
  • b) When a structure variable is defined (static on stack/data, dynamic on heap)
  • c) Only when you call malloc()
  • d) Never — members share memory

Answer: b) When a structure variable is defined (static on stack/data, dynamic on heap)

Memory is allocated for a struct's members when the struct variable itself comes into existence. For a local variable, that's when the function is entered (stack). For a global struct, that's at program start (data segment). For a struct obtained via malloc, that's when you call malloc. Just defining the struct type (e.g., struct Point { int x; };) allocates nothing — it's just a template.

Members & Access

Q9. Which operator is used to access a member of a structure variable in C?

  • a) ->
  • b) .
  • c) ::
  • d) >

Answer: b) .

The dot operator (.) accesses a member via a struct variable: p.x. The arrow operator (->) is used when you have a pointer to a struct: ptr->x. The :: operator is C++ scope resolution — not valid in C. The > is just the greater-than comparison operator. The dot is the most basic member-access operator and the one you'll use most often.

Q10. Which operator is used to access members of a structure pointer in C?

  • a) .
  • b) ->
  • c) ::
  • d) >

Answer: b) ->

When you have a pointer to a struct, use the arrow operator: ptr->x. This is a shorthand for (*ptr).x — dereference first, then access with the dot. The arrow is more readable and is the idiomatic way to access members through pointers in C. You'll see it constantly in linked-list and tree code.

Q11. How are structure members accessed using a structure variable in C?

  • a) ::
  • b) -
  • c) .
  • d) ->

Answer: c) .

The dot operator is the answer for direct struct variables. To access the "rollno" of a Student variable s, write s.rollno. This is a fundamental C syntax rule — if you see a struct variable (not a pointer), use dot. If you see a struct pointer, use arrow.

Q12. What is the correct way to initialize a struct variable?

struct Point { int x; int y; };
  • a) struct Point p = (10, 20);
  • b) struct Point p = {10, 20};
  • c) struct Point p = [10, 20];
  • d) Point p = {10, 20};

Answer: b) struct Point p = {10, 20};

Struct initialization uses braces, with values in the order members are declared. So {10, 20} assigns 10 to x and 20 to y. Parentheses (option A) are used in C++ constructors, not C. Brackets (option C) are for arrays, and D omits the struct keyword (only valid if you used typedef first).

Q13. What happens when you assign one struct variable to another?

  • a) The pointer is copied, so both refer to the same memory
  • b) All members are copied (shallow copy)
  • c) Compilation error
  • d) Only the first member is copied

Answer: b) All members are copied (shallow copy)

C allows direct assignment between structs of the same type: struct Point p2 = p1;. This copies every member, byte by byte. It's a "shallow copy" — if a member is a pointer, the pointer value is copied, not the data it points to. This is one of the few operations C does for you automatically on structs (the other is passing to/from functions).

sizeof, Padding & Alignment

Q14. What is the size of an empty structure in C (GCC)?

  • a) 0
  • b) 1
  • c) 2
  • d) Depends on the compiler / undefined

Answer: d) Depends on the compiler / undefined

This is a surprisingly tricky question. The C standard says an empty struct is not allowed, but GCC and some compilers accept it and give it size 0. Other compilers may give size 1. So "0" is what GCC does, but the standard doesn't guarantee it. For exams based on GCC, a) 0 is often accepted; for strict C standards, there's no correct answer because it's UB. The safest exam answer is d).

Q15. What is the sizeof of the following struct on a typical 32-bit or 64-bit system?

struct Student {
    int rollno;
    char name[20];
};
  • a) 20
  • b) 24
  • c) 12
  • d) 16

Answer: b) 24

int is 4 bytes, and char[20] is 20 bytes — that's 24 bytes, so why is it 24 and not 20 or 28? Because the compiler may add padding to keep the struct's total size a multiple of the largest alignment requirement (here 4). 4 (int) + 20 (char array) = 24, which is already a multiple of 4, so no extra padding is needed. Result: 24 bytes. If the int came after the char array, you'd see padding and possibly a larger size.

Q16. Why is sizeof(struct) sometimes larger than the sum of its member sizes?

  • a) The compiler is buggy
  • b) Due to padding added for memory alignment
  • c) Because struct members always take 8 bytes
  • d) It never happens

Answer: b) Due to padding added for memory alignment

CPUs access memory faster when data is aligned to natural boundaries (e.g., an int on a 4-byte boundary). To achieve this, compilers insert invisible "padding" bytes between members. Example: struct { char c; int i; } on a typical system has size 8, not 5 — 3 bytes of padding after c. This is one of the most-tested C interview questions.

Q17. What does #pragma pack(1) do to a structure in C?

  • a) Forces padding to 1-byte alignment, eliminating padding
  • b) Increases padding to 1 byte between members
  • c) Packs the struct into a single byte
  • d) Has no effect

Answer: a) Forces padding to 1-byte alignment, eliminating padding

#pragma pack(1) tells the compiler not to add padding bytes between members, effectively packing them byte-by-byte. This reduces struct size but may hurt performance (misaligned accesses can be slow or even crash on some architectures). It's commonly used in networking protocols and binary file formats where the struct's binary layout must match an external spec exactly.

Q18. Which of the following statements is true about structure size in C?

  • a) The size of a structure is always equal to the sum of the sizes of its members
  • b) A structure can have both static and dynamic members
  • c) A structure's size may be larger than the sum of its members due to padding
  • d) A structure always stores its members in reverse order

Answer: c) A structure's size may be larger than the sum of its members due to padding

Option a) is a common misconception — padding makes the actual size larger or equal, never smaller. Option b) is false — "static" applies to variables, not individual members. Option d) is nonsense — members are stored in declaration order, not reverse. Option c) captures the truth: sizeof(struct) ≥ sum of member sizes, with padding filling the gaps.

Unions

Q19. Which keyword is used to define a union in C?

  • a) union
  • b) typedef
  • c) struct
  • d) uniondef

Answer: a) union

The union keyword introduces a union definition: union Number { int i; float f; };. Just like struct, typedef can create an alias, and struct creates a different data type entirely. "uniondef" doesn't exist. Unions are similar to structs syntactically but differ in memory layout — a key distinction tested in almost every C exam.

Q20. What is the size of a union in C?

  • a) Sum of sizes of all members
  • b) Size of the largest member (plus possible padding)
  • c) Minimum size of all members
  • d) Size of the first member

Answer: b) Size of the largest member (plus possible padding)

In a union, all members share the same memory — so the union must be big enough to hold its largest member. For union { int i; char c; double d; }, the size is sizeof(double) = 8 bytes. The compiler may add a little padding for alignment, but the base size is determined by the largest member. This is the entire memory-saving point of unions.

Q21. How is a union variable declared in C?

  • a) union tag varname;
  • b) union varname = { };
  • c) union varname { };
  • d) union varname ();

Answer: a) union tag varname;

Same pattern as struct: keyword + tag + variable name. For example: union Number n; declares a union variable named n of type union Number. Just like with structs, you need the tag in scope before declaring a variable of that type. The original question had a typo (option A started with "b)") which is now fixed.

Q22. Which operator is used to access a member of a union variable?

  • a) .
  • b) ->
  • c) ::
  • d) >

Answer: a) .

Unions use the same access operators as structs: dot (.) for union variables, arrow (->) for pointers to unions. So if you have union Number n;, you write n.i = 10;. This syntactic consistency is convenient — once you know struct access, you know union access.

Q23. What is the purpose of using unions in C programs?

  • a) To organize related data types together
  • b) To define functions with multiple return values
  • c) To save memory by storing different types in the same location
  • d) To create constants

Answer: c) To save memory by storing different types in the same location

The whole point of a union is memory savings: you allocate one block sized for the largest member, and reuse it for whichever member you need at the time. Structs organize data (option a) — that's a different job. Option b) is not a union-specific feature. If you don't need the memory savings, use a struct; use a union when memory is tight or when the same location can meaningfully hold one of several types.

Q24. Which statement is true about unions in C?

  • a) Unions are used to allocate memory for multiple members simultaneously
  • b) Unions can contain only one member at a time (only one is meaningfully active)
  • c) Unions store members in contiguous memory locations
  • d) Unions have a fixed size based on the size of the first member

Answer: b) Unions can contain only one member at a time (only one is meaningfully active)

All union members share the same memory, so writing to one member overwrites the others. Only the most recently written member holds meaningful data. The size is determined by the largest member (not the first). Option c) is misleading — union members are not laid out side-by-side like struct members; they overlap. Option a) is the opposite of how unions work.

Q25. Can a union contain another union as a member in C?

  • a) Yes
  • b) No

Answer: a) Yes

Unions can be nested freely in C, just like structs. You can have a union inside a union, a struct inside a union, or a union inside a struct. For example: union Outer { int i; union Inner { char c; } inner; };. The original question had "Answer: b) No" which was incorrect — nested unions are legal.

Q26. What is the sizeof of the following union on a typical system?

union Test {
    int a;
    char b;
};
  • a) 2
  • b) 4
  • c) 1
  • d) 8

Answer: b) 4

The union's size is determined by its largest member. int is 4 bytes, char is 1 byte, so the union is 4 bytes. That's enough to hold either an int or a char — but not both simultaneously. This is the practical difference between struct and union in one example: a struct with the same members would be 5 or 8 bytes (with padding), but a union is only 4.

Q27. What happens if you read a different union member than the one last written?

  • a) You get the last written value converted
  • b) Undefined behaviour — you get a reinterpretation of the underlying bits
  • c) The program crashes
  • d) You get zero

Answer: b) Undefined behaviour — you get a reinterpretation of the underlying bits

If you write to union.a (int) and then read union.b (char), the char you get is the first byte of the int's bit pattern. On most systems this "works" (they use it for type punning), but the C standard technically calls this undefined behaviour. Reading a float after writing an int might give you a completely nonsensical floating-point value. Unions are meant to be written and read through the same member in sequence.

Q28. What is a tagged union in C?

  • a) A union with a special compiler directive
  • b) A struct containing a union and a tag field that indicates which member is active
  • c) A union with only one member
  • d) A union that cannot be modified

Answer: b) A struct containing a union and a tag field that indicates which member is active

A tagged union (also called a "variant" or "discriminated union") combines a struct with a union, using an enum or int member to track which union member is valid. For example: struct Value { int tag; union { int i; float f; } data; };. This makes safe unions possible — you always know which member to read. Very common in parsers, interpreters, and AST representations.

Structures vs Unions

Q29. What is the main difference between a structure and a union in terms of memory?

  • a) Structures allocate memory for all members; unions allocate memory only for the largest member
  • b) Structures use heap; unions use stack
  • c) Structures are faster
  • d) There is no difference

Answer: a) Structures allocate memory for all members; unions allocate memory only for the largest member

This is the fundamental difference. In a struct, each member has its own memory, so you can use all members simultaneously. In a union, all members share one memory block, so writing to one overwrites the others. Use struct when you need multiple values at once; use union when only one value is needed at a time and you want to save memory.

Q30. Which of the following is true about both structures and unions in C?

  • a) Both can be passed to functions
  • b) Both can be nested inside each other
  • c) Both use the dot operator for member access
  • d) All of the above

Answer: d) All of the above

Structures and unions share much of their syntax — the dot operator for variables, arrow for pointers, both can be passed to functions (by value or pointer), both can be nested, and both can be initialized with braces. The only major difference is memory layout: structs give each member its own memory; unions overlap them. So all three options here are true.

Q31. Can structures and unions be nested within each other in C?

  • a) No, it is not allowed
  • b) Yes, but only structures can be nested
  • c) Yes, both structures and unions can be nested in any combination
  • d) Yes, but only unions can be nested

Answer: c) Yes, both structures and unions can be nested in any combination

C allows full nesting: struct-in-struct, union-in-struct, struct-in-union, and union-in-union. You can build complex data hierarchies this way. For example, a struct representing a network packet might contain a union for different payload types, and each payload type might itself be a struct. This flexibility is one of the reasons C is used for low-level data structures.

Q32. Can unions be passed as arguments to functions in C?

  • a) Yes, by value or by pointer
  • b) No, only structs can be passed
  • c) Only by pointer
  • d) Only if the union has one member

Answer: a) Yes, by value or by pointer

Unions are passable to functions just like structs. Pass by value (a copy of the union is made) or by pointer (more efficient for large unions). Just like with structs, pass by const pointer if the function shouldn't modify the original. The original question had "Answer: a) Yes" — which is correct, but the full answer includes both pass-by-value and pass-by-pointer.

Pointers to Structures

Q33. Why do we use pointers to structures in C?

  • a) To access members efficiently and avoid copying large structs
  • b) To store large amounts of data
  • c) To reduce the size of structures
  • d) To make the struct read-only

Answer: a) To access members efficiently and avoid copying large structs

Passing a struct by value copies all its bytes — expensive if the struct is large. Passing a pointer (typically 8 bytes) avoids the copy entirely, and the function can modify the original struct. This is why most real C APIs take pointers to structs rather than structs by value. Option d) is done with const, not pointers alone. Option c) is wrong — pointers don't shrink the struct, they just avoid copying it.

Q34. What is the correct way to access member x of a struct pointed to by ptr?

  • a) *ptr.x
  • b) ptr->x
  • c) ptr.x
  • d) &ptr.x

Answer: b) ptr->x

The arrow operator is the idiomatic way to access a member through a pointer: ptr->x. This is equivalent to (*ptr).x — note the parentheses around *ptr, because . has higher precedence than *. Writing *ptr.x (option a) would try to dereference the result of ptr.x, which is a compile error. Option c) treats ptr as a struct value, not a pointer. Option d) takes the address of a struct member (also valid but not what's asked).

Q35. What is the correct way to access member x of a struct pointed to by ptr using the dot operator?

  • a) *ptr.x
  • b) (*ptr).x
  • c) ptr.*x
  • d) ptr.x*

Answer: b) (*ptr).x

To use the dot operator with a struct pointer, you must first dereference the pointer, then access the member: (*ptr).x. The parentheses are essential — without them, *ptr.x would be interpreted as *(ptr.x), which is wrong. In practice, most C programmers prefer ptr->x because it's more readable, but knowing both forms matters for exams.

Q36. Can a structure contain a pointer to itself in C?

  • a) No, it would be infinitely large
  • b) Yes, but only as a pointer, not as a direct member
  • c) Yes, as a direct member too
  • d) Only in C++

Answer: b) Yes, but only as a pointer, not as a direct member

A self-referential struct contains a pointer to its own type, like struct Node { int data; struct Node *next; };. A pointer has a fixed size (e.g., 8 bytes), so the struct doesn't become infinitely large. If you tried to embed another Node directly inside (not as a pointer), the compiler would error because it can't determine the size. Self-referential structs are the building blocks of linked lists, trees, and graphs.

Structures & Functions

Q37. Can structures be passed as arguments to functions in C?

  • a) Yes, by value or by pointer
  • b) No
  • c) Only by pointer
  • d) Only by value

Answer: a) Yes, by value or by pointer

You can pass a struct by value (the function receives a full copy) or by pointer (the function receives the address). By value is simple but can be expensive for large structs. By pointer is efficient and lets the function modify the original. Best practice: use const struct* for read-only access, or struct* if the function needs to modify the struct.

Q38. What is the purpose of the typedef keyword when defining structures in C?

  • a) To create an alias for the struct type, so you can omit the struct keyword
  • b) To declare a new type of structure
  • c) To prevent the struct definition from being modified
  • d) To declare the structure as a constant

Answer: a) To create an alias for the struct type, so you can omit the struct keyword

typedef creates a shorthand name: typedef struct Point { int x; } Point; lets you write Point p; instead of struct Point p;. It's a convenience, not a new type — just an alias. It doesn't prevent modification (option c is wrong) and doesn't make the struct constant (option d is wrong). Option b is misleading — the struct still exists; typedef just gives it another name.

Q39. Which of the following is true about passing a struct by value to a function?

  • a) The function receives the same memory as the caller
  • b) The function receives a full copy — changes to the copy do not affect the original
  • c) The struct is automatically converted to a pointer
  • d) The struct becomes read-only

Answer: b) The function receives a full copy — changes to the copy do not affect the original

Passing a struct by value means the function gets its own copy, byte-for-byte. If the function modifies the parameter, the caller's struct is untouched. This is safe but can be expensive for large structs. To let the function modify the original, pass a pointer (struct Point *p) — that's "pass by pointer", which simulates pass by reference in C.

Q40. Can you compare two struct variables with the == operator in C?

  • a) Yes, C compares them member by member
  • b) No, C does not allow direct comparison — you must compare member by member
  • c) Yes, if the structs have the same size
  • d) Only if you typedef the struct

Answer: b) No, C does not allow direct comparison — you must compare member by member

This is one of C's most surprising rules for beginners. Unlike assignment (which copies all members automatically), comparison is not defined for structs. You must write a function that compares each member explicitly: if (p1.x == p2.x && p1.y == p2.y). Using memcmp() works only if the struct has no padding, which is rare. This is a frequent interview question.

Advanced Topics

Q41. What is a bit-field in a C structure?

  • a) A field that can only hold 0 or 1
  • b) A member that takes a specified number of bits instead of bytes
  • c) A special pointer to a bit
  • d) A union with only boolean members

Answer: b) A member that takes a specified number of bits instead of bytes

Bit-fields let you pack data tightly: struct Flags { unsigned int a : 1; unsigned int b : 3; unsigned int c : 4; };. Here a takes 1 bit, b takes 3 bits, and c takes 4 bits — all packed into a single unsigned int. This is used in embedded systems, protocols, and anywhere memory is precious. Careful: the exact layout of bit-fields is implementation-defined, so avoid relying on a specific binary layout.

Q42. What does an anonymous structure mean in C?

  • a) A struct without a tag name
  • b) A struct that cannot be instantiated
  • c) A struct with no members
  • d) A struct with a random name

Answer: a) A struct without a tag name

An anonymous struct has no tag after the struct keyword: struct { int x; int y; } p;. This is often used with typedef or as a nested member inside another struct/union. Anonymous structs can be used only once — you can't refer to the type by name later because it has no name. Useful for one-off groupings.

Q43. Can you declare an array of structures in C?

  • a) Yes, using the normal array syntax
  • b) No, only pointers can be arrays
  • c) Only with malloc
  • d) Only if the struct has one member

Answer: a) Yes, using the normal array syntax

Arrays of structs are completely normal: struct Student s[10]; declares 10 Student structs. Access each member with double indexing: s[i].rollno. This is how you typically store a "list" of records in C — for example, a database of students, employees, or products. Combined with loops, arrays of structs give you C's equivalent of a lightweight list.

Q44. What is the correct way to define a struct type that can be used with the alias "Point" without writing "struct Point" everywhere?

  • a) typedef struct Point { int x; int y; } Point;
  • b) struct Point typedef { int x; int y; };
  • c) Point struct { int x; int y; };
  • d) struct typedef Point { int x; int y; };

Answer: a) typedef struct Point { int x; int y; } Point;

The pattern typedef struct Tag { ... } Alias; gives the struct type both a tag (Point) and an alias (Point — often the same). Now you can write Point p; directly without the struct keyword. This is one of the most common idioms in C codebases. Options b, c, and d are invalid C syntax.

Frequently Asked Questions

What is the difference between a structure and a union in C?

A structure allocates separate memory for each member, so all members can be accessed independently. A union allocates one shared block of memory large enough for the largest member, so only one member can be meaningfully used at a time. Use struct for storing multiple related values; use union to save memory when only one value is needed at a time.

Why is sizeof(struct) larger than the sum of its members in C?

Compilers add padding bytes between members to align them on memory boundaries. For example, int must be 4-byte aligned on most systems, so a char followed by an int might get 3 padding bytes in between. This makes memory access faster but increases struct size. Use #pragma pack to reduce padding if needed.

How do you pass a structure to a function in C?

You can pass it by value (the function gets a full copy) or by pointer (the function gets the address). Passing by pointer is preferred for large structs because it avoids the copy cost. Use const struct* param if the function should not modify the original.

What does typedef struct do in C?

typedef creates an alias for the structure type, so you can write the alias name directly without the 'struct' keyword. For example, typedef struct { int x; } Point; lets you declare Point p; instead of struct Point p;. It's a convenience, not a new type.

Can you compare two structures with the == operator in C?

No. C does not support direct equality comparison for structs. You must compare member by member, or use memcmp() carefully if the struct has no padding. This is different from many other languages and is a common exam and interview question.

💡 Tip: Structures are the foundation of data modeling in C — they show up in linked lists, file records, function parameters, and network packets. Master the dot vs arrow operator, understand why padding makes sizeof bigger, and know the struct vs union memory difference cold. Those three topics appear in nearly every interview.

📖 Related MCQ Pages

  • Introduction to C MCQ
  • Operators MCQ
  • Conditional Statements MCQ
  • Loops MCQ
  • Arrays MCQ
  • Functions MCQ
  • Pointers MCQ
  • Files MCQ
  • Storage Classes MCQ
  • Dynamic Memory MCQ

Previous Topic: -->> Functions MCQ   ||   Next topic: -->> Pointers MCQ in C


C Language

  • Home
  • Why C Language
  • History of C Language
  • Applications of C Language
  • Introduction To C
    • What is Program?
    • Structure of C Program
    • Working Of C Program
    • CHARACTER SET
    • VARIABLES AND IDENTIFIERS
    • BUILT-IN DATA TYPES
    • OPERATORS AND EXPRESSIONS
    • CONSTANTS AND LITERALS
    • SIMPLE ASSIGNMENT STATEMENT
    • BASIC INPUT/OUTPUT STATEMENT
    • SIMPLE 'C' PROGRAMS
    • Assignments
  • Operators in C Programming
    • Arithmetic Operators
    • Assignment Operators
    • Increment and Decrement Operators
    • Relational Operators
    • Logical Operators
    • Bitwise Operators
    • Other Operators
    • Assignments
  • Conditional Statements
    • DECISION MAKING WITHIN A PROGRAM
    • CONDITIONS
    • IF STATEMENT
    • IF-ELSE STATEMENT
    • IF-ELSE LADDER
    • NESTED IF-ELSE
    • SWITCH CASE
    • Assignments
  • Loops Statements
    • Introduction to Loops
    • GO TO Statement
    • Do while Loop
    • While Loop
    • Nested While Loop
    • Difference Between While and Do while
    • Difference Between Goto and loop
    • while loop assignments
    • C FOR Loop
    • C For loop examples
    • Nested for loop
    • Nested for loop examples
    • Infinite while Loops
    • Infinite for Loops
    • Continue in Loops
    • break in Loops
    • difference while do..while & for
    • Assignments
  • Arrays
    • One Dimensional Array
    • Declaring 1D Arrays
    • Initilization of 1D arrays
    • Accessing element of one 1D Array
    • Read and Display 1D Arrays
    • Two Dimensional Arrays
    • Declare 2D Arrays
    • Read and Display 2D Arrays
    • Assignments/Examples
  • Functions
    • Introduction
    • Need For User-Defined Function
    • Multiple Function Program
    • Modular Programming
    • Elements Of User Defined Function
    • Function Definition
    • Function Declaration
    • Types of functions
    • Nesting of Function
    • Recursion
    • Passing Array To Functions
    • Scope,Visibility and Lifetime of Variables
    • Assignments
  • Structure
    • Introduction
    • Array vs Structure
    • Defining Structure
    • Declaring Structure Variables
    • Type Defined Structure
    • Accessing Structure Members
    • Structure Initilization
    • Copying & Comparing Structure Variables
    • Array of Structure
    • Arrays Within Structure
    • Structures Within Structures
    • Structures and Functions
    • Structure Examples/Assignments
  • Union
    • Define Union
    • Create and use Union
    • Difference Between Structure and Union
    • Union Examples
    • Union FAQ
  • Pointers
    • What Are Pointers In C?
    • How Do We Use Pointers In C?
    • Declaration Of A Pointer
    • The Initialization Of A Pointer
    • Syntax Of Pointer Initialization
    • Use Of Pointers In C
    • The Pointer To An Array
    • The Pointer To A Function
    • The Pointer To A Structure
    • Types Of Pointers
    • The Null Pointer
    • The Void Pointer
    • The Wild Pointer
    • The Near Pointer
    • The Huge Pointer
    • The far Pointer
    • dangling pointer
    • Accessing Pointers- Indirectly And Directly
    • Pros Of Using Pointers In C
    • Cons Of Pointers In C
    • Applications Of Pointers In C
    • The & Address Of Operator In C
    • How To Read The Complex Pointers In C?
    • Practice Problems On Pointers
  • File Processing
    • File Handling In C
    • Types Of Files In C
    • Operations Done In File Handling
    • File Examples
    • Binary Files
    • count words,lines in a file
    • Copy files
    • Update File
    • count vowels in a file
  • Preprocessor
    • Macro substitution division
    • File Inclusion
    • Conditional Compilation
    • Other directives
    • Examples
  • Dynamic Memory Allocation
    • malloc
    • calloc
    • free
    • realloc
    • Examples
  • Storage Classes
  • Graphics
  • Frequently Asked Interview Questions (FAQ)
    • Introduction To C FAQ
    • Operators FAQ
    • Conditional Statements FAQ
    • Loops FAQ
    • Arrays FAQ
    • Function FAQ
    • Structure FAQ
    • Pointers FAQ
    • Files FAQ
    • Storage classes FAQ
    • Dynamic Memory FAQ
  • Programs/Assignments
    • Introduction To C
    • Operators
    • Conditional Statements
    • Loops
    • Arrays
    • Function
    • Structure
    • Pointers
    • Files
    • Storage classes
    • Dynamic Memory
  • Case Studies
  • Multiple Choice Questions
    • Introduction To C MCQ
    • Operators MCQ
    • Conditional Statements MCQ
    • Loops MCQ
    • Arrays MCQ
    • Function MCQ
    • Structure MCQ
    • Pointers MCQ
    • Files MCQ
    • Storage classes MCQ
    • Dynamic Memory MCQ
    • More MCQ

Get in touch

  • tech2dsm@gmail.com

© Sankalan Data Tech. All rights reserved.