Aditya
Aditya
Subject C Programming
Subject Code BCA - 202
Batch 2023-2026
Session 2024-2025
Semester II
Section C
Project No. 1
Student’s Signature*
Signature of Faculty
*By signing the above you attest that you have contributed to this submission and confirm that all work you
have contributed to this submission is your own work. Any suspicion of copying or plagiarism in this work
will result in an investigation of Academic Misconduct and may result in a “0” on the work, or
possibly more severe penalties, as well as a Disciplinary Notice on your academic record.
AIM: Create a Report Card for class 12th of ASB School, Noida.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_STUDENTS 50
#define SUBJECTS 5
typedef struct {
char name[50];
float marks[SUBJECTS];
float percentage;
char grade;
} Student;
}
student->percentage = (total / SUBJECTS);
}
}
printf("Topper Details:\n");
printStudentDetails(students[maxIndex]);
}
int main() {
int n;
printf("Enter the number of students: ");
scanf("%d", &n);
if (n > MAX_STUDENTS) {
printf("Maximum number of students allowed is %d\n", MAX_STUDENTS);
return 1;
}
Student students[n];
}
calculatePercentageAndGrade(&students[i]);
}
int choice;
printf("\nMenu:\n");
printf("1. Search student details\n");
printf("2. Print details of the topper\n");
printf("3. Students with percentage less than 50%%\n");
printf("Enter your choice: ");
scanf("%d", &choice);
switch (choice) {
case 1: {
char searchName[50];
printf("\nEnter the name of the student you want to search: ");
scanf("%s", searchName);
int found = 0;
for (int i = 0; i < n; i++) {
if (strcmp(students[i].name, searchName) == 0) {
printf("Student found!\n");
printStudentDetails(students[i]);
found = 1;
break;
}
}
if (!found) {
printf("Student not found!\n");
}
break;
}
case 2:
printTopper(students, n);
break;
case 3:
printBelow50Percent(students, n);
break;
default:
printf("Invalid choice!\n");
}
return 0;
}
Output: