Help me find the error

#include<stdio.h>
void result(int,int,int,float*,float*);
int main()
{
int m1,m2,m3;
float avg,perc;
printf(“enter the numbers\n”);
scanf("%d%d%d",&m1,&m2,&m3);
result(m1,m2,m3,&avg,&perc);
printf(“average is%d \n”,avg);
printf(“percentage is %d\n”,perc);
return 0;
}
void result(int m1,int m2,int m3,floatavg,floatperc)
{
*avg=(m1+m2+m3)/3;
perc=(m1+m2+m3)/300100;
}

Please format your code - the forum software has mangled it and it won’t compile! :slight_smile:

Why do you think there’s an error in it? What input are you providing that results in incorrect output?

the percentage part is showing errors

In fuction void give spaces between data types and variable, and reference them by adding star.
Reference the perc below *avg. Also format document it
Corrected code:
#include <stdio.h>

void result(int, int, int, float *, float *);

int main()

{

int m1, m2, m3;

float avg, perc;



printf("Enter the numbers\n");

scanf("%d %d %d", &m1, &m2, &m3);
printf("average is %d\n", avg);
printf("percentage is %d\n", perc);
return 0;

}

void result(int m1, int m2, int m3, float* avg, float* perc)

{

*avg = (m1 + m2 + m3) / 3;

*perc = (m1 + m2 + m3) / 300100;

}