A development process
So in the first instance, you make
Code:
#include <stdio.h>
void gradeStudent( ) {
int marks, stud, cours, total, sum;
printf( " Enter No Of Students :");
scanf("%d", &stud);
printf(" Enter No 0f Course :");
scanf("%d", &cours);
printf("Enter Mark :");
scanf("%d", &marks);
{
if( marks >= 80 && marks <= 100)
printf( " Grade A");
else if(marks >= 70 )
printf( " Grade B");
else if( marks >= 60 )
printf( " Grade C");
else if( marks >= 50 )
printf( " Grade D");
else if( marks >= 40 )
printf( " Grade E");
else if( marks >= 0 && marks <= 39)
printf( " Grade F");
}
}
int main()
{
gradeStudent();
return 0;
}
But then perhaps, the number of students is the loop variable, so move that part back to main
Code:
int main()
{
int stud;
printf( " Enter No Of Students :");
scanf("%d", &stud);
gradeStudent();
return 0;
}
From there, it's an easy step to
for ( i = 0 ; i < stud
Well, I'm sure you can take it from there.....