הצלחתי את הראשון!:
קוד PHP:
#include <stdio.h>
#include <math.h>
void main()
{
int inputValue=0;
double ArithAverage=0;
double GeometrAvarage=1;
int i =0;
printf("Please Enter a series of 10 positive Integer numbers: ");
printf("\n");
while(1)
{
scanf_s("%d", &inputValue);
if(inputValue < 0)
{
printf("please enter a positive number\n");
}
else if(inputValue > 0)
{
ArithAverage = ArithAverage + inputValue;
GeometrAvarage = GeometrAvarage*inputValue;
i++;
}
if(i == 10)
{
printf ("ArithAverage = %lf\n", ArithAverage/10);
printf ("GeometrAvarage = %lf\n", pow(GeometrAvarage, 0.1));
return;
}
}
}
אבל אני עדיין לא מבין איך לעשות את השני והשלישי