#include
#include
void main()
int i,n;
float a[50],sum=0;
clrscr();
printf("enter No. of elements in the array);
scanf("%d",&n);
for(i=0;i
scanf("%f",&a[i]);
for(i=0;i
sum=sum+a[i];
printf("Sum of no.s in the array is %f",sum);
getch();
}
2006-08-04 05:29:11
·
answer #1
·
answered by Anonymous
·
0⤊
0⤋
How about a for loop?
sum = 0;
for( i = 0; i < 100; i++) sum += array[i];
2006-08-04 05:20:47
·
answer #2
·
answered by rscanner 6
·
0⤊
0⤋
if you want to add all elements of an array than u wud hav to take an array and using for loop enter the elements. after that processing each element u wud hav to add that.
#include
#include
void main()
{
int arr[12],i,sum=0;
printf("Enter the elements\n");
for(i=0;i<12;i++)
{
scanf("%d",&arr[i]);
sum=sum+arr[i];
}
for(i=0;i<12;i++)
printf("%d",arr[i]);
}
2006-08-04 09:28:26
·
answer #3
·
answered by Anonymous
·
0⤊
0⤋
a loop
sum = 0;
for( i = 0; i < "size of array"; i++) sum += array[i];
2006-08-04 05:26:50
·
answer #4
·
answered by . 3
·
0⤊
0⤋
I majored in lit in college. i could say for this poem, you like some historic past on the poet. It starts out kinda unhappy, with the view. 'Futures i've got divorced' maximum like refers to abandoned hopes and desires. The 'do not look returned' and knife reference is possibly approximately getting over painful techniques. That it now not cuts implies wish. Or probable numbness. The stuff on complacency possibly ability he feels he enable somebody down by ability of not doing some thing he could desire to have achieved. for this reason the accusatory voices. The final paragraph is a little extra complicated. My experience is that the narrator found out his existence classes and acted thus, for this reason the massive advantages. This guy feels like a soldier to me. one that believes that not taking action at some considered necessary 2d led to others injury. Now he's grew to become that approach around, and located some peace. He gave up previous and futile tries and took a different lifestyle, and he's beginning to discover his existence extra rewarding. i don't often like poems, yet my mom and dad spents thousands that they did not have so i ought to income to interpret then. i'm extra approximately novels, inspite of the incontrovertible fact that. returned, you may income from understanding some thing of this author's existence. This one is enormously very own, previous the final experience of the sweetness and cruelty of the worldwide I many times see in lesser poems.
2016-11-03 21:18:27
·
answer #5
·
answered by ? 4
·
0⤊
0⤋