✏️ Explanatory Question
struct structure_name
{
Member_variable1;
Member_variable2
.
.
}[structure variables];
#include <stdio.h>
struct student
{
char name[10]; // structure members declaration.
int age;
}s1; //structure variable
int main()
{
printf("Enter the name");
scanf("%s",s1.name);
printf("\n");
printf("Enter the age");
scanf("%d",&s1.age);
printf("\n");
printf("Name and age of a student: %s,%d",s1.name,s1.age);
return 0;
}
Output:
Enter the name shikha
Enter the age 26
Name and age of a student: shikha,26