#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main()
{
	int x=1, a, b, c, d, e, f, g;

	printf("\nNumero de Pessoas:");
	scanf("%i", &a);
	
	for(x ; x <= a ; x++)
	{
	    printf("\nInforme Idade:");
	    scanf("%i",&b);
	    c+=b;		
        d=c/a;
        printf("\nA media dos numeros foi:%i\n\n\n\n",d);
    }
    
    if(d > 0 && d <= 25)
    {
    	printf("Turma Jovem");
	}
    else if(d > 25 && d <= 60)
    {
    	printf("Turma Adulta");
	}
    else if(d > 60 && d <= 130)
    {
    	printf("Turma Idosa");
	}
    else if(d < 0 || d > 130)
    {
    	printf("A Media nao e valida");
	}
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: