C program to find the size of a union

0
#include<stdio.h>
 
union student{
 
    int roll;
 
    char name[100];
 
    float marks;
};
 
int main(){
 
  union student *ptr = 0;
 
  ptr++;
  
 printf("Size of the union student:  %d",ptr);
 
  return 0;
}

Output

Size of the union student: 100

Leave a Reply

Your email address will not be published. Required fields are marked *