consider the following C code
main()
{
int i=3,x;
while(i>0)
{
x=func(i);
i--;
}
int func(int n)
{
static sum=0;
sum=sum+n;
return(sum);
}
the final value of x is

Answer Posted / yogendra jain

6

Is This Answer Correct ?    15 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can math operations be performed on a void pointer?

593


How to draw the flowchart for structure programs?

8764


How can I make sure that my program is the only one accessing a file?

684


what is the height of tree if leaf node is at level 3. please explain

1604


What is difference between class and structure?

575






What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?

610


What is pivot in c?

570


Is malloc memset faster than calloc?

622


cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration

640


Why & is used in scanf in c?

629


can anyone please tell about the nested interrupts?

1678


Why isn't any of this standardized in c? Any real program has to do some of these things.

630


Explain what are the advantages and disadvantages of a heap?

599


What is the newline escape sequence?

591


Is there anything like an ifdef for typedefs?

708