#include<stdio.h>
#include<conio.h>
struct student
{
int rollno;
char name[20];
int number_present;
int number_absent;
};
void main()
{
struct student s[10];
int i;
clrscr();
printf("enter the data for the students:\n\n");
for(i=0;i<2;i++)
{
printf("enter the rollnumber:");
scanf("%d",&s[i].rollno);
printf("\n\nenter the name:");
scanf("%s",&s[i].name);
printf("\n\n enter the total days");
scanf("%d",&s[i].number_present);
printf("\n\nenter the absent days");
scanf("%d",&s[i].number_absent);
}
printf("data for student:\n\n");
for(i=0;i<2;i++)
{
printf("roll number=%d",s[i].rollno);
printf("name=%s\n\n",s[i].name);
printf("total present day=%d\n\n",s[i].number_present);
printf("total absence day=%d\n\n",s[i].number_absent);
}
getch();
}
0 comments:
Post a Comment