Răspuns:
#include <stdio.h>
int sum(int a,int b,int suma);
int sum1(int b,int c,int suma);
int sum2(int a,int c,int suma);
int main()
{
int a,b,c,i,suma;
printf("dati valori lui a b si c:");
scanf("%d%d%d",&a,&b,&c);
printf("s(%d,%d)=%d",a,b,sum(a,b,suma));
printf("\ns(%d,%d)=%d",b,c,sum1(b,c,suma));
printf("\ns(%d,%d)=%d",a,c,sum2(a,c,suma));
return 0;
}
int sum(int a,int b,int suma)
{
int i;
suma=0;
for(i=a;i<=b;i++)
suma+=i;
return suma;
}
int sum1(int b,int c,int suma)
{
int i;
suma=0;
for(i=b;i<=c;i++)
suma+=i;
return suma;
}
int sum2(int a,int c,int suma)
{
int i;
suma=0;
for(i=a;i<=c;i++)
suma+=i;
return suma;
}
Explicație:
nu cred ca e o problema daca este in C