#include<stdio.h>
int SumElement(int *,int);
void main(void)
{
int x[10];
int i=10;
for(;i;)
{
i--;
*(x+i)=i;
}
printf("%d",SumElement(x,10));
}
int SumElement(int array[],int size)
{
int i=0;
float sum=0;
for(;i<size;i++)
sum+=array[i];
return sum;
}
output?
Answer Posted / madhu
Ans is 45.
for(exp1;exp2;exp3)
So the 2nd expression when once it becomes 0 control comes
out of for loop and executes the funtion which gives the
answer as 45
0+1+2+3+4+5+6+7+8+9
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.
Write a simple code fragment that will check if a number is positive or negative.
Explain how do you declare an array that will hold more than 64kb of data?
On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area
Is c is a high level language?
Can I initialize unions?
Is javascript written in c?
What language is c written?
What is operator precedence?
Which is better malloc or calloc?
Does c have function or method?
Write a program to generate random numbers in c?
What is c system32 taskhostw exe?
What are the modifiers available in c programming language?
Explain what header files do I need in order to define the standard library functions I use?