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
Why is extern used in c?
How can I discover how many arguments a function was actually called with?
How can you pass an array to a function by value?
How can a program be made to print the line number where an error occurs?
Why shouldn’t I start variable names with underscores?
What is the c value paradox and how is it explained?
How can I write a function analogous to scanf?
What is an arrays?
What does s c mean on snapchat?
What is nested structure in c?
What are header files why are they important?
Is c weakly typed?
How can you read a directory in a C program?
Why do we need a structure?
what is event driven software and what is procedural driven software?