#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
struct student
{
int rollno;
char name[30];
int marks;
}stud[3];
int i;
clrscr();
for(i=0;i<3;i++)
{
printf("Enter Roll no : ");
scanf("%d",&stud[i].rollno);
printf("Enter Name of student : ");
scanf("%s",&stud[i].name);
printf("Enter Marks : " );
scanf("%d",&stud[i].marks);
}
printf("\n STUDENT DETAILS");
printf("\n------------------------------------------------------------------------------");
printf("\n ROLL NO NAME MARKS");
printf("\n------------------------------------------------------------------------------\n");
for(i=0;i<3;i++)
{
printf("\t%7d",stud[i].rollno);
printf("\t\t %s",stud[i].name);
printf("\t\t\t%3d\n",stud[i].marks);
}
printf("\n------------------------------------------------------------------------------");
getch();
}
/*
OUTPUT:
Enter Roll no : 01
Enter Name of student : PAYAL
Enter Marks : 70
Enter Roll no : 02
Enter Name of student : URMILA
Enter Marks : 75
Enter Roll no : 03
Enter Name of student : KAJAL
Enter Marks : 65
STUDENT DETAILS
------------------------------------------------------------------------------
ROLL NO NAME MARKS
------------------------------------------------------------------------------
1 PAYAL 70
2 URMILA 75
3 KAJAL 65
------------------------------------------------------------------------------
*/
#include<conio.h>
#include<string.h>
void main()
{
struct student
{
int rollno;
char name[30];
int marks;
}stud[3];
int i;
clrscr();
for(i=0;i<3;i++)
{
printf("Enter Roll no : ");
scanf("%d",&stud[i].rollno);
printf("Enter Name of student : ");
scanf("%s",&stud[i].name);
printf("Enter Marks : " );
scanf("%d",&stud[i].marks);
}
printf("\n STUDENT DETAILS");
printf("\n------------------------------------------------------------------------------");
printf("\n ROLL NO NAME MARKS");
printf("\n------------------------------------------------------------------------------\n");
for(i=0;i<3;i++)
{
printf("\t%7d",stud[i].rollno);
printf("\t\t %s",stud[i].name);
printf("\t\t\t%3d\n",stud[i].marks);
}
printf("\n------------------------------------------------------------------------------");
getch();
}
/*
OUTPUT:
Enter Roll no : 01
Enter Name of student : PAYAL
Enter Marks : 70
Enter Roll no : 02
Enter Name of student : URMILA
Enter Marks : 75
Enter Roll no : 03
Enter Name of student : KAJAL
Enter Marks : 65
STUDENT DETAILS
------------------------------------------------------------------------------
ROLL NO NAME MARKS
------------------------------------------------------------------------------
1 PAYAL 70
2 URMILA 75
3 KAJAL 65
------------------------------------------------------------------------------
*/