#include<stdio.h>
#include<conio.h>
struct student
{
char name[20];
int roll;
int mark;
};
void main()
{
struct student a[5];
int i;
for(i=0;i<5;i++)
{
printf("enter name %d, roll no and marks\n",i+1);
scanf("%s%d%d",a[i].name,&a[i].roll,&a[i].mark);
}
printf("the data you have entered are:\n");
printf("name\troll no\tmark\n");
for(i=0;i<5;i++)
{
printf("%s\t%d\t%d\n",a[i].name,a[i].roll,a[i].mark);
}
}
#include<conio.h>
struct student
{
char name[20];
int roll;
int mark;
};
void main()
{
struct student a[5];
int i;
for(i=0;i<5;i++)
{
printf("enter name %d, roll no and marks\n",i+1);
scanf("%s%d%d",a[i].name,&a[i].roll,&a[i].mark);
}
printf("the data you have entered are:\n");
printf("name\troll no\tmark\n");
for(i=0;i<5;i++)
{
printf("%s\t%d\t%d\n",a[i].name,a[i].roll,a[i].mark);
}
}
No comments:
Post a Comment