Just paste this into your main function:
double d1,d2,d3;
printf("\nEnter first double: ");
scanf("%lf",&d1);
printf("\nEnter second double: ");
scanf("%lf",&d2);
printf("\nEnter third double: ");
scanf("%lf",&d3);
d1 = (d1+d2+d3)/3;
printf("\nAverage = %lf ", d1);