logo

Crowdly

Kas bus atspausdinta ekrane? #include <stdio.h> int suma(int A[], int n) ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Kas bus atspausdinta ekrane?

#include <stdio.h>

int suma(int A[], int n)

{

  int suma=A[0], maks=suma;

  for (int i=1;i<n;i++)

  {

    if (A[i]>maks)

      {

        suma+=A[i];

       maks=A[i];

  }

}

return suma;

}

int main()

{

  int A[10]={1,2,1,2,3,1,2,3,4,-5},s;

  s=suma(A,8);

  printf("%d\n",s);

return 0;

}

More questions like this

Want instant access to all verified answers on moodle.vilniustech.lt?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!