Write a c program to find the size of union without using sizeof operator






How to find size of union data type without using sizeof operator in c programming language  


#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;
}





1. Write a c program to convert decimal number to hexadecimal number.
3. Write a c program to convert octal number to decimal number.
4. Write a c program to convert octal number to hexadecimal number.
5. Write a c program to convert hexadecimal number to decimal number.
6. Write a c program to convert hexadecimal number to octal number.
8. Write a c program to convert binary number to hexadecimal number.
9. Write a c program to convert binary number to octal number.
11. Write a c program to convert hexadecimal number to binary number.
12. Write a c program to convert octal number to binary number.
14. Write a c program to convert centigrade to fahrenheit.

No comments: