i have exams tomorrow and i really really need someones help on my problem. here how it goes:

"we have 100 students info such as surname,name,id and grades for 6 lessons for those students.
the program must:

- can take grades from 1 to 10
- can calculate and find which students have average above 5
- we should give the surname of the student and then show us the max grade of that student
- the program will finish when we type the word "end"

please give me all your help i need this soo much its my exams tomorrow and i really need help.thanks in advance!

>please give me all your help i need this soo much its my exams tomorrow and i really need help.thanks in advance!

Sure, tell me the e-mail of your professor at school and I'll ask him to give you a break.

>Sure, tell me the e-mail of your professor at school and I'll ask him to give you a break.

just help me if you can and leave the emails for tomorrow

just help me if you can and leave the emails for tomorrow

Are you this moronic by birth or do you practice day by day?
Don't you remember when your teacher told you that cheating was not good for you?

We don't give school assignment solutions. You would have known that, if you took the time to read the rules of this forum.

Are you this moronic by birth or do you practice day by day?
Don't you remember when your teacher told you that cheating was not good for you?

We don't give school assignment solutions. You would have known that, if you took the time to read the rules of this forum.

so if i write some of the code that i have in mind will you help me solve it?

so if i write some of the code that i have in mind will you help me solve it?

The premise behind this forum is this; to help people that help themselves.
I doubt you make the cut. However, you will always be "encouraged" to show your efforts and to make explicit where you are having troubles with.

The premise behind this forum is this; to help people that help themselves.
I doubt you make the cut. However, you will always be "encouraged" to show your efforts and to make explicit where you are having troubles with.

#include <stdio.h>
#include <string.h>
#define N 100
#define M 6
main()
{
int i,j surname[N],name[N],ID[N],grade[M][N];

for (i=0; i<=N; i++)
{ printf("give name,surname,id of %d student",i+1);
scanf("%s",name,surname,id)
{ 
for (j=0; j<=M; j++)
printf("give grade for the %d lesson,j+1);
scanf("%s",grade[i][j]);
}
if (grade [i][j]>0&&grade[i][j]<10)
 {
     for (i=0; i<N; i++)
{sum=0;
for (j=0; j<M; j++)
sum=sum+grade[i][j];
avg=sum/6;

is ti correct so far?????????

>is ti correct so far?????????
No! Not at all. int i,j, surname[N],name[N],ID[N],grade[M][N]; Tell me! What type should be the memory that will hold a name or surname? And grade? scanf("%s",name,surname,id) Three type of variables, but I only see one "%s" format operator. scanf("%s",grade[i][j]); At best, grade[j] would be a single char or int, which can not receive a formatted "%s".

(*rats I wasn't first reply :( *) int i,j surname[N],name[N],ID[N],grade[M][N]; Declares all of those variables as integer. Should some of them have character data?

The format in scanf("%s",name,surname,id) will only read one string value. surname and id will be empty. (But as noted above, name, surname and id are all integers anyway.)

This for statement:

for (j=0; j<=M; j++)
printf("give grade for the %d lesson,j+1);

does not have any braces on it and so will loop only the first statement.

You don't have enough matching braces yet, could you try to compile it and post code that compiles?

and when posting c code, please use c code tags
[code=c] /* Your code here */

[/code]

This article has been dead for over six months. Start a new discussion instead.