i was expecting a output asking score but no printf fnx is working.
[](https://i.sstatic.net/MOIA52pB.png)
#include<stdio.h>
float percentage(float a, float b, float c);
float main(){
float a,b,c;
printf("enter sci marks: ");
scanf("%f",&a);
printf("enter maths marks: ");
scanf("%f",&b);
printf("enter sans marks: ");
scanf("%f",&c);
float var = percentage(a,b,c);
printf(" percentage = %f", var);
return 0;
}
float percentage(float a,float b,float c){
float var = (a + b + c)/3.0 ;
return var;
}
was expecting the program to ask for all three inputs and then give percentage.
New contributor
Kumar Mohit is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.