C Program to Calculate Size of Structure using Sizeof Operator

Levels of difficulty: / perform operation:

C Program

struct stud {
	int roll;
	char name[10];
	int marks;
int main() {
	int size;
	struct stud s;
	size = sizeof(s);
	printf("nSize of Structure : %d", size);

Size of the Structure Can be Evaluated using “sizeof Operator”

total size =   sizeof(roll) + sizeof(name) + sizeof(mark)