0% found this document useful (0 votes)
55 views

Studentt

The document defines a Student struct with fields for name, surname, index, and GPA. It includes functions to print a student's details and print the details of students with a GPA over 8.5. The main function prompts the user for the number of students, collects their details into an array of structs, prints all students, and then prints the stipend recipients.

Uploaded by

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

Studentt

The document defines a Student struct with fields for name, surname, index, and GPA. It includes functions to print a student's details and print the details of students with a GPA over 8.5. The main function prompts the user for the number of students, collects their details into an array of structs, prints all students, and then prints the stipend recipients.

Uploaded by

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

Subject: Student

To: [email protected], Miroslav Ivanovski <[email protected]>,


[email protected]

#include <stdio.h>

struct Student
{
char ime[20];
char prezime[30];
int index;
float prosek;
};
void pecatiStudent(struct Student s)
{
printf("%s %s Index: %d Prosek: %.2f\n",s.ime,s.prezime,s.index,s.prosek);
}
void stipendisti(struct Student s[],int n)
{
int i;
for(i=0;i<n;i++)
{
if(s[i].prosek>=8.5)
{
pecatiStudent(s[i]);
}
}
}
int main()
{
struct Student s[10];
int n,i;
printf("Kolku studenti?\n");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("Vnesi go imeto na %d-ot student\n",i+1);
scanf("%s",s[i].ime);
printf("Vnesi go prezimeto na %d-ot student\n",i+1);
scanf("%s",s[i].prezime);
printf("Vnesi go index na %d-ot student\n",i+1);
scanf("%d",&s[i].index);
printf("Vnesi go prosek na %d-ot student\n",i+1);
scanf("%f",&s[i].prosek);
}
printf("=============Lista od studenti============\n");
for(i=0;i<n;i++)
{
pecatiStudent(s[i]);
}
printf("=============Lista od studenti - stipendisti============\n");
stipendisti(s,n);
}

You might also like