#include <stdio.h>
struct Student
{
int roll_number;
char name[50];
char address[100];
int marks;
};
int main()
{
struct Student students[10];
int i;
// Read the records of 10 students
for (i = 0; i < 10; i++) {
printf("Enter details of student %d:\n", i+1);
printf("Roll Number: ");
scanf("%d", &students[i].roll_number);
printf("Name: ");
scanf("%s", students[i].name);
printf("Address: ");
scanf("%s", students[i].address);
printf("Marks: ");
scanf("%d", &students[i].marks);
}
// Display the records of students who obtained greater than 250
printf("\nStudents who obtained greater than 250:\n");
for (i = 0; i < 10; i++)
{
if (students[i].marks > 250)
{
printf("Roll Number: %d\n", students[i].roll_number);
printf("Name: %s\n", students[i].name);
printf("Address: %s\n", students[i].address);
printf("Marks: %d\n", students[i].marks);
printf("\n");
}
}
return 0;
}
OUTPUT
User inputs information of 10 students: