what will be the output of the following program, justify?
#define TEST
int TEST getdata()
{
static i;
i+=10;
return i;
}
main()
{
int k;
k = getdata();
}
Answer Posted / rkr
The Static variable is initialized to zero
In the above program
static i; which is equivalent to static i = 0;
Next line i is incrementing by 10, then i value is 10.
return the value is 10
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
What is the use of a conditional inclusion statement in C?
Explain how are portions of a program disabled in demo versions?
What are the types of data files?
What is 'bus error'?
What is build process in c?
How are structure passing and returning implemented?
What is struct node in c?
What are static variables in c?
Differentiate call by value and call by reference?
Explain why c is faster than c++?
Do array subscripts always start with zero?
which is conditional construct a) if statement b) switch statement c) while/for d) goto
Can we access the array using a pointer in c language?
application attempts to perform an operation?
What is huge pointer in c?