Answer this question in Comment...
Write a program to input teacher id, name, address and subject of 10 teachers and display them properly using structure.
#include<stdio.h>
struct teacher
{
int id;
char n[10], a[10], s[10];
};
struct teacher t[10];
int main( )
{
int i;
printf(“Enter teachers id, name, address and subject”);
for(i=1;i<=10;i++)
{
scanf(“%d %s %s %s”, &t[i].id, t[i].n, t[I].a, t[i].s);
}
printf(“Entered data are:”);
for(i=1;i<=10;i++)
{
printf(“%d %s %s %s”, t[i].id, t[i].n, t[i].a, t[i].s);
}
return 0;
}
0 Comments
I really appreciate for your words. Thank you very much for your comment.