On the keyboard type sequence records containing data of a medical examination of schoolchildren: Full name, date of birth, height and weight.Print out entered data in a table sorting them by names of the students alphabetically.
struct data{
char name [20];
int age;
int weight
};
int main(){
struct stuff;
for(int i = 0; i < 20; i++){
scanf("%c", stuff.name[i]);
}
scanf("%i", stuff.age);
scanf("%i", stuff.weight);
}
You need a couple of other things in that struct to start with.
Your specification asks for date of birth, not age. It also asks for a height variable. Do you know what units your height and weight are to be in? If you store them as integers, you're limiting yourself to whole numbers.
And what do you mean by "having trouble doing the sorting"? Are you having trouble getting started? Do you have a near working solution or is your program crashing? We can help you better if you provide us some more details of your problem. Providing the code section that's giving you problems will help as well.
this is the assignment!! please i need this for today.
On the keyboard type sequence records containing data of a medical examination of schoolchildren: Full name, date of birth, height and weight.Print out entered data in a table sorting them by names of the students alphabetically.