Structure in c
In C programming, "structure" refers to a user-defined composite data type that allows you to group variables of different types under a single name. Structures are used to represent a record, such as a student record or a complex data entity.
In C, a structure is defined using the 'struct' keyword followed by a name (identifier) for the structure, and inside curly braces '{}'' you define one or more members (variables) of various data types.
struct student {
  int id;
  char name[50];
  float percentage;
};
After defining a structure, you can declare variables of that structure type :
struct student s1, s2;
You can access the members of a structure variable using the dot '.' operator :
s1.id = 1;
strcpy(s1.name, "John Doe");
s1.percentage = 85.5;
You can initialize structure variables during declaration :
struct student s1 = {1, "John Doe", 85.5};
Ouput :
Enter Name, Roll and Marks :Rokeiya  
25  
90
Name=Rokeiya   Roll=25   Marks=90.000000
Ouput :
Enter the 1st value in feet and inch:
5
9
Enter the 2nd value in feet and inch:
5
4
Sum of Distance is:
11'1.000000
Ouput :
Enter the name :Rokeiya
Enter Marks:90
Enter Marks:95
Enter Marks:85
Enter Marks:80
Rokeiya
The student's Result is:
90 95 85 80
Understanding structures is fundamental in C programming for managing and organizing data effectively. They provide a way to represent real-world entities or abstract data structures in a manner that is both intuitive and efficient. Mastering structures is essential for building complex programs and data structures in C.