Write a program that the teacher to enter the marks scored in computer by 10 students. Find and print the average marks of the group
satagr:
yup
Answers
Answered by
0
here is the code in total with sub function that let you to input multiple time with grading system. Please edit as your needs.
--------------------------------------------------------------
# include <stdio.h>
float verify (float a)
{
float output;
if (a>=80)
{
output=4;
}
else if (a>=75 && a<=79){
output= 3.75;
}
else if (a>=70 && a<=74){
output= 3.5;
}
else if (a>=65 && a<=69){
output= 3.25;
}
else if (a>=60 && a<=64){
output= 3.0;
}
else if (a>=55 && a<=59){
output= 2.5;
}
else if (a>=50 && a<=54){
output= 2.0;
}
else if (a>=40 && a<=49){
output= 1.0;
}
else
{ output= 0.0;}
return output;
}
int main ()
{
a:
float number ;
printf("Please Enter the course result marks: ");
scanf("%f", &number);
printf("The GPA is: %f", verify (number));
return 0;
goto a;
--------------------------------------------------------------
# include <stdio.h>
float verify (float a)
{
float output;
if (a>=80)
{
output=4;
}
else if (a>=75 && a<=79){
output= 3.75;
}
else if (a>=70 && a<=74){
output= 3.5;
}
else if (a>=65 && a<=69){
output= 3.25;
}
else if (a>=60 && a<=64){
output= 3.0;
}
else if (a>=55 && a<=59){
output= 2.5;
}
else if (a>=50 && a<=54){
output= 2.0;
}
else if (a>=40 && a<=49){
output= 1.0;
}
else
{ output= 0.0;}
return output;
}
int main ()
{
a:
float number ;
printf("Please Enter the course result marks: ");
scanf("%f", &number);
printf("The GPA is: %f", verify (number));
return 0;
goto a;
Similar questions
Biology,
7 months ago
English,
7 months ago
Physics,
1 year ago
Chemistry,
1 year ago
Social Sciences,
1 year ago