0
Need help with c code for mark sheet for students with n subjects and mark allocation with respect to number of subjects
C code may-day
9 ответов
+ 1
OK. So you'll need additional array for subjects, and an integer for the number of subjects, plus the related inputs.
Since you have a variable number of elements (subjects and marks), I recommend a very careful reading on the dynamic memory allocation lessons - malloc, etc. This avoids wasting memory with fixed size arrays with the maximum expected size.
+ 1
So ask a question about it
+ 1
The student structure store The mark in an integer variable. Change that to an array or something that takes multiple values.
Then, use a loop to input all marks for each student.
You probably want an additional array of strings to store subject names - again, include that in the structure and in the input loop.
Is the number of subjects fixed, provided by the user for all students, or different for each student?
0
I need help with how to input multiple marks with respect to the subjecst...
0
So allow people to help you:
1. Link your code in your question (using + button)
2. Explain what it should do
3. Describe what it's doing wrong
With just a vague description of a generic difficulty, how can we know what to help you with?
0
https://code.sololearn.com/ca4Yazbjxk93/?ref=app
The output accepts the input of only 1 mark... I need help adding the subject function for the user to be able to input multiple marks with respect to the number of subjects...
0
No... The number and name of subjects vary... For each student...
0
Ok... Will try that out
0
Thanks