New Want to Write for Computaholics ? if Yes Contact us at "contact@computaholics.in"

C Program Of Union

C Program Of Union

#include<stdio.h>

union student
{
int roll;
char name[20];
}st;

main()
{

printf("Enter Roll no.:\n");
scanf("%d",&st.roll);

printf("Enter name:\n");
scanf("%s",st.name);

printf("%d\n%s\n",st.roll,st.name);

printf("Enter name:\n");
scanf("%s",st.name);

printf("%d\n%s\n",st.roll,st.name);

}
Copyright © C Program | Java | OpenGL Programming | Hadoop at Computaholics