C program to store and display records of N students using union.

#include<stdio.h>

#include<conio.h>
#define N 10
union student{
int rollno;
char name[20];
char gender;
float fees;
};
void main(){
int i;
union student s[N];
for(i=0; i<N; i++){
clrscr();
printf("enter %d student name\n",i+1);
gets(s[i].name);
getch();
}
for(i=0; i<N; i++){
clrscr();
printf("Name of %d student =%s\n",i+1,s[i].name);
getch();
}
}

Comments

Popular posts from this blog

C Language Topics in Hindi and English

C language IMP Questions for BSc/BA/BCom/BCA/BE/BTech/MSc/MCA (CS/IT) I year students