#include <stdio.h>
int main(void)
{
int a[5]={5,4,3,2,1};
int i,sum;
for (int i=0;i<5;i++)
{
sum=sum+a[i];
}
printf("sum=%f\n",sum);
return 0;
}
#include <stdio.h>
int main(void)
{
int a[5]={5,4,3,2,1};
int i,sum;
for (int i=0;i<5;i++)
{
sum=sum+a[i];
}
printf("sum=%f\n",sum);
return 0;
}
#include <stdio.h>
int main(void)
{
int a[5] = {5, 4, 3, 2, 1};
int i, sum = 0;
for (i = 0; i < 5; i++)
{
sum = sum + a[i];
}
printf("sum=%d\n", sum);
return 0;
}