Compare commits
No commits in common. "2c10067d3e548a3e29c5b59b2d7824f0aa4ed57f" and "bc93e0313c88fe468783dd4f899ab832f51d9c5e" have entirely different histories.
2c10067d3e
...
bc93e0313c
11
run
11
run
@ -1,9 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# echo "compile the program.c file..."
|
echo "compile the program.c file..."
|
||||||
# gcc work1/main.c -o program
|
gcc work1/main.c -o program
|
||||||
# echo "run the program..."
|
echo "run the program..."
|
||||||
# ./program
|
./program
|
||||||
|
|
||||||
gcc work1/single.c -o single
|
|
||||||
./single
|
|
@ -1,57 +1,34 @@
|
|||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
|
|
||||||
struct person_tag
|
struct person_tag {
|
||||||
{
|
|
||||||
char name[20];
|
char name[20];
|
||||||
char id[10];
|
char id[10];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct course_tag
|
struct course_tag {
|
||||||
{
|
|
||||||
char course_name[20];
|
char course_name[20];
|
||||||
int no_of_units;
|
int no_of_units;
|
||||||
int marks[4];
|
int marks[4];
|
||||||
float avg;
|
float avg;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct student_tag
|
struct student_tag {
|
||||||
{
|
|
||||||
struct person_tag student_info;
|
struct person_tag student_info;
|
||||||
struct course_tag course_info;
|
struct course_tag course_info;
|
||||||
struct student_tag *next;
|
struct student_tag *next;
|
||||||
};
|
}
|
||||||
|
|
||||||
// core functions
|
void display_students(void);
|
||||||
void display_students();
|
void search_student(void);
|
||||||
void search_student();
|
void find_maximum(void);
|
||||||
void find_maximum();
|
void find_failed(void);
|
||||||
void find_failed();
|
|
||||||
void update_file();
|
void update_file();
|
||||||
void read_file();
|
void read_file();
|
||||||
void quite();
|
void quite();
|
||||||
|
|
||||||
// util functions
|
int main(void) {
|
||||||
void display_menu();
|
printf("Welcome!");
|
||||||
|
|
||||||
int main(void)
|
printf("Goodbye!");
|
||||||
{
|
|
||||||
// varibales
|
|
||||||
int selected;
|
|
||||||
|
|
||||||
printf("Welcome!\n");
|
|
||||||
|
|
||||||
display_menu();
|
|
||||||
|
|
||||||
printf("\nGoodbye!");
|
|
||||||
}
|
|
||||||
|
|
||||||
void display_menu()
|
|
||||||
{
|
|
||||||
printf("(1) Display students’ details\n");
|
|
||||||
printf("(2) Search for a student’s mark\n");
|
|
||||||
printf("(3) Find the details of student with the largest average\n");
|
|
||||||
printf("(4) Find the details of failed students\n");
|
|
||||||
printf("(5) Add new student to the record\n");
|
|
||||||
printf("(6) Quit program\n");
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user