Student marks by using structures
- Get link
- X
- Other Apps
#include <stdio.h>
struct student
{
char name [30];
int marks[ 5];
int total;
};
int main()
{
struct student std;
int i;
printf("Enter name: ");
gets(std.name);
printf("Enter marks:\n");
std.total=0;
for(i=0;i< 5;i++){
printf("Marks in subject %d: ",i+1);
scanf("%d",&std.marks[i]);
std.total+=std.marks[i];
}
return 0;
}
Result

- Get link
- X
- Other Apps
Comments
Post a Comment