#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 |
What is the correct declaration of main?
7. Identify the correct argument for the function call fflush() in ANSI C: A)stdout B)stdin C)stderr D)All the above
Do you know what are the properties of union in c?
in C-programming language without using printf statement can we get output r not ? if yes how and if no also how ?
how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions
Why is structure padding done in c?
What is the use of header files?
What is volatile
write a program of bubble sort using pointer?
What are actual arguments?
What is 02d in c?
write a program to generate address labels using structures?