#include <stdio.h>
#include <locale.h>
#include <conio.h>
#include <string.h>
#include <math.h>
int main()
{
int array[5];
int x;
int max;
int y;
float k;
printf("Enter capacity of array")
scanf("%d",&y);
for(x=0;x<y;x++)
{
printf("Enter the numbers:");
scanf("%d",&array[x]);
max*=array[x];
}
k=pow(max,(1/y) );
printf("%d\n",max);
printf(" %f",k);
getch();
}
Hello everyone, I want find geometric average but I always get k=1 I know it's simple code but I can't see the problem, can anyone help me?