#include<stdio.h>
#include<conio.h>
struct record_ko
{char name[20];
int stno;
char fav_color[20];
}record[5];
void main()
{clrscr();
int no;
for(int i=0;i<5;i++)
{printf("\nwhats your name? ");
scanf("%s",record[i].name);
printf("what is your student number?? ");
scanf("%d",&record[i].stno);
printf("what is your favorite color? ");
scanf("%s",record[i].fav_color);
}
for(i=0;i<5;i++)
{printf("\nname:%s\t\t\t \nstudent no:%d\t\t\t \nfavorite color:%s\t\t",record[i].name,record[i].stno ,record[i].fav_color);
}
getch();
}
geemicah 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.