#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?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / deepa
ther wud be no amswer as the for loop is executed infinitly
Is This Answer Correct ? | 3 Yes | 1 No |
When would you use a pointer to a function?
Differentiate call by value and call by reference?
Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?
#include<stdio.h> void main() { char *str; long unsigned int add; str="Hello C"; add=&str[0]; printf("%c",add); } What is the output?
What is conio h in c?
what is mean by Garbage collection ? Please answer me. Advance thanks.
Explain in detail how strset (string handling function works )pls explain it with an example.
Describe how arrays can be passed to a user defined function
What is the difference between mpi and openmp?
What are called c variables?
WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?
what is the different bitween abap and abap-hr?