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
Explain what are preprocessor directives?
What is main function in c?
What is the value of h?
Write a c program to build a heap method using Pointer to function and pointer to structure ?
What is the process to create increment and decrement stamen in c?
What is the difference between if else and switchstatement
pierrot's divisor program using c or c++ code
How can I split up a string into whitespace-separated fields?
Can we increase size of array in c?
Explain what is meant by 'bit masking'?
What is modeling?
What is the scope of global variable in c?
Does c have class?
Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10
How can a program be made to print the name of a source file where an error occurs?