0% found this document useful (0 votes)
5 views3 pages

Part B Program 11 Array of Structure

The document contains a C program that demonstrates the use of a structure to manage student records. It allows the user to input details for 'n' students, including their name, roll number, and percentage, and then displays this information. The program utilizes an array of structures to store and handle the student data.

Uploaded by

antonyjacob689
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views3 pages

Part B Program 11 Array of Structure

The document contains a C program that demonstrates the use of a structure to manage student records. It allows the user to input details for 'n' students, including their name, roll number, and percentage, and then displays this information. The program utilizes an array of structures to store and handle the student data.

Uploaded by

antonyjacob689
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

/*part B:Program 11:

Program to demostrate student structure to read and


display records of n student.
*/
// note:above program is a example of array of structure

#include<stdio.h>
struct student
{
char name[30];
int roll;
float percentage;
};
void main()
{
struct student s[20];
int i,n;
printf("Enter number of student:\n");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("Enter student name:");
scanf("%s",s[i].name);
printf("Enter student roll number:");
scanf("%d",&s[i].roll);
printf("Enter student percentage:");
scanf("%f",&s[i].percentage);
}
printf("\n Student Details:\n");
for(i=0;i<n;i++)
{

printf("\t %s",s[i].name);
printf("\t %d",s[i].roll);
printf("\t %f",s[i].percentage);
printf("\n");
}
}

You might also like