- #1
cs23
- 66
- 0
#include <stdio.h>
int main()
{
double sum, theta[100];
int i;
sum = 0.0;
i = 0;
while (i < 100)
{
sum = sum + theta;
i = i + 1;
}
printf("The sum of the array is %lf\n", sum);
}
when i run it i get a wrong answer...i don't know how to initialize the array
int main()
{
double sum, theta[100];
int i;
sum = 0.0;
i = 0;
while (i < 100)
{
sum = sum + theta;
i = i + 1;
}
printf("The sum of the array is %lf\n", sum);
}
when i run it i get a wrong answer...i don't know how to initialize the array