forked from Stutiagrawal10/Competitive_Programming
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheligibleforHacktober.c
More file actions
41 lines (35 loc) · 822 Bytes
/
Copy patheligibleforHacktober.c
File metadata and controls
41 lines (35 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include<stdio.h>
struct value{
char name[15];
int n;
};
void main()
{
struct value a[100];//maximum 100 student data can be updated
int total, n, num=0;
printf("Total number of students appear:");
scanf("%d",&total);
for(int i=1; i<=total; i++)
{
printf("\nEnter name and No. of repository(PR) for student no %d\n",i);
printf("Name: ");
scanf("%s",a[i].name);
printf("No. of Repositories: ");
scanf("%d",&a[i].n);
}
printf("\nStudents eligible are: \n");
for(int i=1;i<=total;i++)
{
if(a[i].n>=4)
{
num=num+1;
printf("\t\t%d. %s\n",num,a[i].name);
}
else
{
num=num;
}
}
//printf("No. of Students eligible are %d",num);
//Can use for displaying total no. of students eligible
}