Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
int Vektori[10]={0};
int i=0;
int k=0;
//tässä kannattaa olla tarkkana, jotta summa sopii muuttujaan
long int Summa=0;


int LaskeKeskiarvo(int Tulo)
{
    Vektori[i]=Tulo;
    i++;
    if(i==10)i=0;
    Summa=0;
    for(k=0;k<10;k++)
    {
        Summa+=Vektori[k];
    }
    return Summa/10;
}