#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 output of the code and how? main() { int *ptr,x; x=sizeof(ptr); printf("%d",x); }
What is structure in c definition?
Explain how can type-insensitive macros be created?
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it?
what would be the output of the following prog? Justify your answer? main() { unsigned char ch; unsigned char i; ch = -255; printf("%d",ch); i = -1; printf("%d",i); }
What are volatile variables in c?
increment operateor (++)and decrament(--) #include<stdio.h> #inclide<conio.h> main() { int x=15; while(x!=0) scanf("%d",&x); {
What is || operator and how does it function in a program?
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
WHAT IS FLOAT?
What is the total generic pointer type?
What are the key features in c programming language?