- Joined
- Aug 3, 2022
- Messages
- 1
- Reaction score
- 0
#include <stdio.h>
double calculateSum(double age[]) {
double sum = 0.0;
for (int i = 0; i < 7; ++i) {
sum += age;
}
return sum;//wants return sum from this function
}
int main() {
double result, age[7];
printf("Enter seven numbers: ");
for(int i=0;i<7;++i)
{
scanf("%lf ", age);//wants elements of age[7] array from user
}
result = calculateSum(age);
printf("Result = %.2lf", result); //wants to print result
return 0;
}/*run hone ke baad fault aa rha hai
showing ->
proot info: vpid 1: terminated with signal 11
[Process completed (code 255) - press Enter]*/
double calculateSum(double age[]) {
double sum = 0.0;
for (int i = 0; i < 7; ++i) {
sum += age;
}
return sum;//wants return sum from this function
}
int main() {
double result, age[7];
printf("Enter seven numbers: ");
for(int i=0;i<7;++i)
{
scanf("%lf ", age);//wants elements of age[7] array from user
}
result = calculateSum(age);
printf("Result = %.2lf", result); //wants to print result
return 0;
}/*run hone ke baad fault aa rha hai
showing ->
proot info: vpid 1: terminated with signal 11
[Process completed (code 255) - press Enter]*/