#include<stdio.h>
void func(int a, int b, int c, float *avg, float *per);
void main()
{
int a, b, c;
float tot, per;
printf("Enter the marks of subject 1: ");
scanf("%d", &a);
printf("Enter the marks of subject 2: ");
scanf("%d", &b);
printf("Enter the marks of subject 3: ");
scanf("%d", &c);
func(a, b, c, &tot, &per);
printf("\n The Total: %.2f", tot);
printf("\n The Percentage: %.2f%%", per);
}
void func(int a, int b, int c, float *tot, float *per)
{
*tot = (a+b+c);
*per = ((a+b+c)/300.0)*100;
}