0

Help me write a program in c that show information of 10 students

And prints the results, ( stud No., Stud reg No., Fname, lastname,course and year of study) Enter results for any 2 course untis and carryout the following stats Compute mean, max I know nothing //C program for entering details in an array. #include <stdio.h> struct student { char fName[50]; int studno; float marks; } stu[10]; int main() { int i; printf("Enter information of students:\n"); // storing information for (i = 0; i < 5; ++i) { stu[i].studno = i + 1; printf("\nFor roll number%d,\n", stu[i].studno); printf("Enter first name: "); scanf("%s", stu[i].fName); printf("Enter marks: "); scanf("%f", &stu[i].marks); } printf("Displaying Information:\n\n"); // displaying information for (i = 0; i < 5; ++i) { printf("\nRoll number: %d\n", i + 1); printf("First name: "); puts(stu[i].fName); printf("Marks: %.1f", stu[i].marks); printf("\n"); } return 0; }

4th Apr 2022, 7:05 AM
Nyanzi Raymas
Nyanzi Raymas - avatar
5 Réponses
+ 4
Yeah, no problems. Can you come over and clean the leaves out of my gutters? {Edit: that would be a silly request.... For your program: do you know how to use struct? make a SoloLearn "code bit" and edit your original post to link it. even if it's half finished, we will help you then}
4th Apr 2022, 7:07 AM
HungryTradie
HungryTradie - avatar
+ 1
😑
4th Apr 2022, 7:09 AM
Nyanzi Raymas
Nyanzi Raymas - avatar
+ 1
Da fuk☺️
4th Apr 2022, 7:24 AM
Nyanzi Raymas
Nyanzi Raymas - avatar
+ 1
I added a code the thier
4th Apr 2022, 7:44 AM
Nyanzi Raymas
Nyanzi Raymas - avatar
0
I know mate, and I sold my thumbs on SoloLearn for $1000 just the other day..... {edit: that looks like a great start Nyanzi Raymas I've got to cook dinner for my family now, but hopefully someone else will guide you to making your add and display codes into functions.}
4th Apr 2022, 7:15 AM
HungryTradie
HungryTradie - avatar